]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/author/struct.stdout
Merge commit 'f51aade56f93175dde89177a92e3669ebd8e7592' into clippyup
[rust.git] / src / tools / clippy / tests / ui / author / struct.stdout
1 if_chain! {
2     if let ExprKind::Struct(qpath, fields, None) = expr.kind;
3     if match_qpath(qpath, &["Test"]);
4     if fields.len() == 1;
5     if fields[0].ident.as_str() == "field";
6     if let ExprKind::If(cond, then, Some(else_expr)) = fields[0].expr.kind;
7     if let ExprKind::DropTemps(expr1) = cond.kind;
8     if let ExprKind::Lit(ref lit) = expr1.kind;
9     if let LitKind::Bool(true) = lit.node;
10     if let ExprKind::Block(block, None) = then.kind;
11     if block.stmts.is_empty();
12     if let Some(trailing_expr) = block.expr;
13     if let ExprKind::Lit(ref lit1) = trailing_expr.kind;
14     if let LitKind::Int(1, LitIntType::Unsuffixed) = lit1.node;
15     if let ExprKind::Block(block1, None) = else_expr.kind;
16     if block1.stmts.is_empty();
17     if let Some(trailing_expr1) = block1.expr;
18     if let ExprKind::Lit(ref lit2) = trailing_expr1.kind;
19     if let LitKind::Int(0, LitIntType::Unsuffixed) = lit2.node;
20     then {
21         // report your lint here
22     }
23 }
24 if_chain! {
25     if let PatKind::Struct(ref qpath, fields, false) = arm.pat.kind;
26     if match_qpath(qpath, &["Test"]);
27     if fields.len() == 1;
28     if fields[0].ident.as_str() == "field";
29     if let PatKind::Lit(lit_expr) = fields[0].pat.kind;
30     if let ExprKind::Lit(ref lit) = lit_expr.kind;
31     if let LitKind::Int(1, LitIntType::Unsuffixed) = lit.node;
32     if arm.guard.is_none();
33     if let ExprKind::Block(block, None) = arm.body.kind;
34     if block.stmts.is_empty();
35     if block.expr.is_none();
36     then {
37         // report your lint here
38     }
39 }
40 if_chain! {
41     if let PatKind::TupleStruct(ref qpath, fields, None) = arm.pat.kind;
42     if match_qpath(qpath, &["TestTuple"]);
43     if fields.len() == 1;
44     if let PatKind::Lit(lit_expr) = fields[0].kind;
45     if let ExprKind::Lit(ref lit) = lit_expr.kind;
46     if let LitKind::Int(1, LitIntType::Unsuffixed) = lit.node;
47     if arm.guard.is_none();
48     if let ExprKind::Block(block, None) = arm.body.kind;
49     if block.stmts.is_empty();
50     if block.expr.is_none();
51     then {
52         // report your lint here
53     }
54 }
55 if_chain! {
56     if let ExprKind::MethodCall(method_name, args, _) = expr.kind;
57     if method_name.ident.as_str() == "test";
58     if args.len() == 1;
59     if let ExprKind::Path(ref qpath) = args[0].kind;
60     if match_qpath(qpath, &["test_method_call"]);
61     then {
62         // report your lint here
63     }
64 }