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.rs43
1 files changed, 21 insertions, 22 deletions
diff --git a/tests/ui-fulldeps/pprust-expr-roundtrip.rs b/tests/ui-fulldeps/pprust-expr-roundtrip.rs
index e417a6a83..ae375dfab 100644
--- a/tests/ui-fulldeps/pprust-expr-roundtrip.rs
+++ b/tests/ui-fulldeps/pprust-expr-roundtrip.rs
@@ -73,11 +73,10 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
let mut g = |e| f(expr(e));
- for kind in 0..=19 {
+ for kind in 0..=18 {
match kind {
- 0 => iter_exprs(depth - 1, &mut |e| g(ExprKind::Box(e))),
- 1 => iter_exprs(depth - 1, &mut |e| g(ExprKind::Call(e, thin_vec![]))),
- 2 => {
+ 0 => iter_exprs(depth - 1, &mut |e| g(ExprKind::Call(e, thin_vec![]))),
+ 1 => {
let seg = PathSegment::from_ident(Ident::from_str("x"));
iter_exprs(depth - 1, &mut |e| {
g(ExprKind::MethodCall(Box::new(MethodCall {
@@ -90,26 +89,26 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
}))
)});
}
- 3..=8 => {
+ 2..=7 => {
let op = Spanned {
span: DUMMY_SP,
node: match kind {
- 3 => BinOpKind::Add,
- 4 => BinOpKind::Mul,
- 5 => BinOpKind::Shl,
- 6 => BinOpKind::And,
- 7 => BinOpKind::Or,
- 8 => BinOpKind::Lt,
+ 2 => BinOpKind::Add,
+ 3 => BinOpKind::Mul,
+ 4 => BinOpKind::Shl,
+ 5 => BinOpKind::And,
+ 6 => BinOpKind::Or,
+ 7 => BinOpKind::Lt,
_ => unreachable!(),
},
};
iter_exprs(depth - 1, &mut |e| g(ExprKind::Binary(op, e, make_x())));
iter_exprs(depth - 1, &mut |e| g(ExprKind::Binary(op, make_x(), e)));
}
- 9 => {
+ 8 => {
iter_exprs(depth - 1, &mut |e| g(ExprKind::Unary(UnOp::Deref, e)));
}
- 10 => {
+ 9 => {
let block = P(Block {
stmts: ThinVec::new(),
id: DUMMY_NODE_ID,
@@ -120,7 +119,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 => {
+ 10 => {
let decl = P(FnDecl { inputs: thin_vec![], output: FnRetTy::Default(DUMMY_SP) });
iter_exprs(depth - 1, &mut |e| {
g(ExprKind::Closure(Box::new(Closure {
@@ -136,14 +135,14 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
})))
});
}
- 12 => {
+ 11 => {
iter_exprs(depth - 1, &mut |e| g(ExprKind::Assign(e, make_x(), DUMMY_SP)));
iter_exprs(depth - 1, &mut |e| g(ExprKind::Assign(make_x(), e, DUMMY_SP)));
}
- 13 => {
+ 12 => {
iter_exprs(depth - 1, &mut |e| g(ExprKind::Field(e, Ident::from_str("f"))));
}
- 14 => {
+ 13 => {
iter_exprs(depth - 1, &mut |e| {
g(ExprKind::Range(Some(e), Some(make_x()), RangeLimits::HalfOpen))
});
@@ -151,16 +150,16 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
g(ExprKind::Range(Some(make_x()), Some(e), RangeLimits::HalfOpen))
});
}
- 15 => {
+ 14 => {
iter_exprs(depth - 1, &mut |e| {
g(ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, e))
});
}
- 16 => {
+ 15 => {
g(ExprKind::Ret(None));
iter_exprs(depth - 1, &mut |e| g(ExprKind::Ret(Some(e))));
}
- 17 => {
+ 16 => {
let path = Path::from_ident(Ident::from_str("S"));
g(ExprKind::Struct(P(StructExpr {
qself: None,
@@ -169,10 +168,10 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
rest: StructRest::Base(make_x()),
})));
}
- 18 => {
+ 17 => {
iter_exprs(depth - 1, &mut |e| g(ExprKind::Try(e)));
}
- 19 => {
+ 18 => {
let pat =
P(Pat { id: DUMMY_NODE_ID, kind: PatKind::Wild, span: DUMMY_SP, tokens: None });
iter_exprs(depth - 1, &mut |e| g(ExprKind::Let(pat.clone(), e, DUMMY_SP)))