]> git.lizzy.rs Git - rust.git/blob - tests/ui/match_ref_pats.stderr
Auto merge of #68717 - petrochenkov:stabexpat, r=varkor
[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    |
27 help: instead of prefixing all patterns with `&`, you can dereference the expression
28    |
29 LL |     match *tup {
30 LL |         (v, 1) => println!("{}", v),
31    |
32
33 error: you don't need to add `&` to both the expression and the patterns
34   --> $DIR/match_ref_pats.rs:23:5
35    |
36 LL | /     match &w {
37 LL | |         &Some(v) => println!("{:?}", v),
38 LL | |         &None => println!("none"),
39 LL | |     }
40    | |_____^
41    |
42 help: try
43    |
44 LL |     match w {
45 LL |         Some(v) => println!("{:?}", v),
46 LL |         None => println!("none"),
47    |
48
49 error: you don't need to add `&` to all patterns
50   --> $DIR/match_ref_pats.rs:35:5
51    |
52 LL | /     if let &None = a {
53 LL | |         println!("none");
54 LL | |     }
55    | |_____^
56    |
57 help: instead of prefixing all patterns with `&`, you can dereference the expression
58    |
59 LL |     if let None = *a {
60    |            ^^^^   ^^
61
62 error: you don't need to add `&` to both the expression and the patterns
63   --> $DIR/match_ref_pats.rs:40:5
64    |
65 LL | /     if let &None = &b {
66 LL | |         println!("none");
67 LL | |     }
68    | |_____^
69    |
70 help: try
71    |
72 LL |     if let None = b {
73    |            ^^^^   ^
74
75 error: you don't need to add `&` to all patterns
76   --> $DIR/match_ref_pats.rs:67:9
77    |
78 LL | /         match foo_variant!(0) {
79 LL | |             &Foo::A => println!("A"),
80 LL | |             _ => println!("Wild"),
81 LL | |         }
82    | |_________^
83    |
84 help: instead of prefixing all patterns with `&`, you can dereference the expression
85    |
86 LL |         match *foo_variant!(0) {
87 LL |             Foo::A => println!("A"),
88    |
89
90 error: aborting due to 6 previous errors
91