From 0eab7d956d24e4741581e1ec51eb0536d4d36e3f Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 26 Sep 2018 22:10:40 -0700 Subject: [PATCH] OneVector type alias has been removed --- tests/test_precedence.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_precedence.rs b/tests/test_precedence.rs index 90c48e8fe3..93d50a4575 100644 --- a/tests/test_precedence.rs +++ b/tests/test_precedence.rs @@ -27,6 +27,8 @@ extern crate quote; extern crate rayon; extern crate regex; extern crate rustc_data_structures; +#[macro_use] +extern crate smallvec; extern crate syn; extern crate syntax; extern crate walkdir; @@ -215,8 +217,8 @@ fn libsyntax_parse_and_rewrite(input: &str) -> Option> { /// /// This method operates on libsyntax objects. fn libsyntax_brackets(libsyntax_expr: P) -> Option> { - use rustc_data_structures::small_vec::OneVector; use rustc_data_structures::thin_vec::ThinVec; + use smallvec::SmallVec; use syntax::ast::{Expr, ExprKind, Field, Mac, Pat, Stmt, StmtKind, Ty}; use syntax::ext::quote::rt::DUMMY_SP; use syntax::fold::{self, Folder}; @@ -261,7 +263,7 @@ fn libsyntax_brackets(libsyntax_expr: P) -> Option> { ty } - fn fold_stmt(&mut self, stmt: Stmt) -> OneVector { + fn fold_stmt(&mut self, stmt: Stmt) -> SmallVec<[Stmt; 1]> { let node = match stmt.node { // Don't wrap toplevel expressions in statements. StmtKind::Expr(e) => StmtKind::Expr(e.map(|e| fold::noop_fold_expr(e, self))), @@ -269,7 +271,7 @@ fn libsyntax_brackets(libsyntax_expr: P) -> Option> { s => s, }; - OneVector::from_vec(vec![Stmt { node, ..stmt }]) + smallvec![Stmt { node, ..stmt }] } fn fold_mac(&mut self, mac: Mac) -> Mac {