]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/match_ref_pats.stderr
Rollup merge of #90202 - matthewjasper:xcrate-hygiene, r=petrochenkov
[rust.git] / src / tools / clippy / tests / ui / match_ref_pats.stderr
1 error: you don't need to add `&` to all patterns
2   --> $DIR/match_ref_pats.rs:7: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 both the expression and the patterns
19   --> $DIR/match_ref_pats.rs:24:5
20    |
21 LL | /     match &w {
22 LL | |         &Some(v) => println!("{:?}", v),
23 LL | |         &None => println!("none"),
24 LL | |     }
25    | |_____^
26    |
27 help: try
28    |
29 LL ~     match w {
30 LL ~         Some(v) => println!("{:?}", v),
31 LL ~         None => println!("none"),
32    |
33
34 error: redundant pattern matching, consider using `is_none()`
35   --> $DIR/match_ref_pats.rs:36:12
36    |
37 LL |     if let &None = a {
38    |     -------^^^^^---- help: try this: `if a.is_none()`
39    |
40    = note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
41
42 error: redundant pattern matching, consider using `is_none()`
43   --> $DIR/match_ref_pats.rs:41:12
44    |
45 LL |     if let &None = &b {
46    |     -------^^^^^----- help: try this: `if b.is_none()`
47
48 error: you don't need to add `&` to all patterns
49   --> $DIR/match_ref_pats.rs:101:9
50    |
51 LL | /         match foobar_variant!(0) {
52 LL | |             &FooBar::Foo => println!("Foo"),
53 LL | |             &FooBar::Bar => println!("Bar"),
54 LL | |             &FooBar::FooBar => println!("FooBar"),
55 LL | |             _ => println!("Wild"),
56 LL | |         }
57    | |_________^
58    |
59 help: instead of prefixing all patterns with `&`, you can dereference the expression
60    |
61 LL ~         match *foobar_variant!(0) {
62 LL ~             FooBar::Foo => println!("Foo"),
63 LL ~             FooBar::Bar => println!("Bar"),
64 LL ~             FooBar::FooBar => println!("FooBar"),
65    |
66
67 error: aborting due to 5 previous errors
68