summaryrefslogtreecommitdiffstats
path: root/tests/ui-fulldeps/pprust-expr-roundtrip.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui-fulldeps/pprust-expr-roundtrip.rs')
-rw-r--r--tests/ui-fulldeps/pprust-expr-roundtrip.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/ui-fulldeps/pprust-expr-roundtrip.rs b/tests/ui-fulldeps/pprust-expr-roundtrip.rs
index 7a91dcf0d..e417a6a83 100644
--- a/tests/ui-fulldeps/pprust-expr-roundtrip.rs
+++ b/tests/ui-fulldeps/pprust-expr-roundtrip.rs
@@ -41,7 +41,7 @@ use rustc_session::parse::ParseSess;
use rustc_span::source_map::FilePathMapping;
use rustc_span::source_map::{FileName, Spanned, DUMMY_SP};
use rustc_span::symbol::Ident;
-use thin_vec::thin_vec;
+use thin_vec::{thin_vec, ThinVec};
fn parse_expr(ps: &ParseSess, src: &str) -> Option<P<Expr>> {
let src_as_string = src.to_string();
@@ -76,17 +76,17 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
for kind in 0..=19 {
match kind {
0 => iter_exprs(depth - 1, &mut |e| g(ExprKind::Box(e))),
- 1 => iter_exprs(depth - 1, &mut |e| g(ExprKind::Call(e, vec![]))),
+ 1 => iter_exprs(depth - 1, &mut |e| g(ExprKind::Call(e, thin_vec![]))),
2 => {
let seg = PathSegment::from_ident(Ident::from_str("x"));
iter_exprs(depth - 1, &mut |e| {
g(ExprKind::MethodCall(Box::new(MethodCall {
- seg: seg.clone(), receiver: e, args: vec![make_x()], span: DUMMY_SP
+ seg: seg.clone(), receiver: e, args: thin_vec![make_x()], span: DUMMY_SP
}))
)});
iter_exprs(depth - 1, &mut |e| {
g(ExprKind::MethodCall(Box::new(MethodCall {
- seg: seg.clone(), receiver: make_x(), args: vec![e], span: DUMMY_SP
+ seg: seg.clone(), receiver: make_x(), args: thin_vec![e], span: DUMMY_SP
}))
)});
}
@@ -111,7 +111,7 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
}
10 => {
let block = P(Block {
- stmts: Vec::new(),
+ stmts: ThinVec::new(),
id: DUMMY_NODE_ID,
rules: BlockCheckMode::Default,
span: DUMMY_SP,
@@ -121,7 +121,7 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
iter_exprs(depth - 1, &mut |e| g(ExprKind::If(e, block.clone(), None)));
}
11 => {
- let decl = P(FnDecl { inputs: vec![], output: FnRetTy::Default(DUMMY_SP) });
+ let decl = P(FnDecl { inputs: thin_vec![], output: FnRetTy::Default(DUMMY_SP) });
iter_exprs(depth - 1, &mut |e| {
g(ExprKind::Closure(Box::new(Closure {
binder: ClosureBinder::NotPresent,
@@ -165,7 +165,7 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
g(ExprKind::Struct(P(StructExpr {
qself: None,
path,
- fields: vec![],
+ fields: thin_vec![],
rest: StructRest::Base(make_x()),
})));
}
@@ -220,7 +220,7 @@ fn main() {
}
fn run() {
- let ps = ParseSess::new(FilePathMapping::empty());
+ let ps = ParseSess::new(vec![rustc_parse::DEFAULT_LOCALE_RESOURCE], FilePathMapping::empty());
iter_exprs(2, &mut |mut e| {
// If the pretty printer is correct, then `parse(print(e))` should be identical to `e`,