]> git.lizzy.rs Git - rust.git/blob - tests/ui/match_ref_pats.stderr
Auto merge of #4314 - chansuke:add-negation-to-is_empty, r=flip1995
[rust.git] / tests / ui / match_ref_pats.stderr
1 error: you don't need to add `&` to all patterns
2   --> $DIR/match_ref_pats.rs:6:9
3    |
4 LL | /         match v {
5 LL | |             &Some(v) => println!("{:?}", v),
6 LL | |             &None => println!("none"),
7 LL | |         }
8    | |_________^
9    |
10    = note: `-D clippy::match-ref-pats` implied by `-D warnings`
11 help: instead of prefixing all patterns with `&`, you can dereference the expression
12    |
13 LL |         match *v {
14 LL |             Some(v) => println!("{:?}", v),
15 LL |             None => println!("none"),
16    |
17
18 error: you don't need to add `&` to all patterns
19   --> $DIR/match_ref_pats.rs:17:5
20    |
21 LL | /     match tup {
22 LL | |         &(v, 1) => println!("{}", v),
23 LL | |         _ => println!("none"),
24 LL | |     }
25    | |_____^
26 help: instead of prefixing all patterns with `&`, you can dereference the expression
27    |
28 LL |     match *tup {
29 LL |         (v, 1) => println!("{}", v),
30    |
31
32 error: you don't need to add `&` to both the expression and the patterns
33   --> $DIR/match_ref_pats.rs:23:5
34    |
35 LL | /     match &w {
36 LL | |         &Some(v) => println!("{:?}", v),
37 LL | |         &None => println!("none"),
38 LL | |     }
39    | |_____^
40 help: try
41    |
42 LL |     match w {
43 LL |         Some(v) => println!("{:?}", v),
44 LL |         None => println!("none"),
45    |
46
47 error: you don't need to add `&` to all patterns
48   --> $DIR/match_ref_pats.rs:34:5
49    |
50 LL | /     if let &None = a {
51 LL | |         println!("none");
52 LL | |     }
53    | |_____^
54 help: instead of prefixing all patterns with `&`, you can dereference the expression
55    |
56 LL |     if let None = *a {
57    |            ^^^^   ^^
58
59 error: you don't need to add `&` to both the expression and the patterns
60   --> $DIR/match_ref_pats.rs:39:5
61    |
62 LL | /     if let &None = &b {
63 LL | |         println!("none");
64 LL | |     }
65    | |_____^
66 help: try
67    |
68 LL |     if let None = b {
69    |            ^^^^   ^
70
71 error: you don't need to add `&` to all patterns
72   --> $DIR/match_ref_pats.rs:66:9
73    |
74 LL | /         match foo_variant!(0) {
75 LL | |             &Foo::A => println!("A"),
76 LL | |             _ => println!("Wild"),
77 LL | |         }
78    | |_________^
79 help: instead of prefixing all patterns with `&`, you can dereference the expression
80    |
81 LL |         match *foo_variant!(0) {
82 LL |             Foo::A => println!("A"),
83    |
84
85 error: aborting due to 6 previous errors
86