]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/author/blocks.stdout
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / author / blocks.stdout
1 if_chain! {
2 if let ExprKind::Block(ref block) = expr.kind;
3 if block.stmts.len() == 2;
4 if let StmtKind::Local(ref local) = block.stmts[0].kind;
5 if let Some(ref init) = local.init;
6 if let ExprKind::Lit(ref lit) = init.kind;
7 if let LitKind::Int(42, _) = lit.node;
8 if let PatKind::Binding(BindingAnnotation::Unannotated, _, name, None) = local.pat.kind;
9 if name.as_str() == "x";
10 if let StmtKind::Semi(ref e, _) = block.stmts[1].kind
11 if let ExprKind::Unary(UnOp::Neg, ref inner) = e.kind;
12 if let ExprKind::Path(ref path) = inner.kind;
13 if match_qpath(path, &["x"]);
14 if block.expr.is_none();
15 then {
16 // report your lint here
17 }
18 }
19 if_chain! {
20 if let ExprKind::Block(ref block) = expr.kind;
21 if block.stmts.len() == 1;
22 if let StmtKind::Local(ref local) = block.stmts[0].kind;
23 if let Some(ref init) = local.init;
24 if let ExprKind::Call(ref func, ref args) = init.kind;
25 if let ExprKind::Path(ref path) = func.kind;
26 if match_qpath(path, &["String", "new"]);
27 if args.len() == 0;
28 if let PatKind::Binding(BindingAnnotation::Unannotated, _, name, None) = local.pat.kind;
29 if name.as_str() == "expr";
30 if let Some(trailing_expr) = &block.expr;
31 if let ExprKind::Call(ref func1, ref args1) = trailing_expr.kind;
32 if let ExprKind::Path(ref path1) = func1.kind;
33 if match_qpath(path1, &["drop"]);
34 if args1.len() == 1;
35 if let ExprKind::Path(ref path2) = args1[0].kind;
36 if match_qpath(path2, &["expr"]);
37 then {
38 // report your lint here
39 }
40 }