]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/match_ref_pats.stderr
New upstream version 1.63.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / match_ref_pats.stderr
CommitLineData
f20569fa 1error: you don't need to add `&` to all patterns
923072b8 2 --> $DIR/match_ref_pats.rs:8:9
f20569fa
XL
3 |
4LL | / match v {
5LL | | &Some(v) => println!("{:?}", v),
6LL | | &None => println!("none"),
7LL | | }
8 | |_________^
9 |
10 = note: `-D clippy::match-ref-pats` implied by `-D warnings`
11help: instead of prefixing all patterns with `&`, you can dereference the expression
12 |
94222f64
XL
13LL ~ match *v {
14LL ~ Some(v) => println!("{:?}", v),
15LL ~ None => println!("none"),
f20569fa
XL
16 |
17
f20569fa 18error: you don't need to add `&` to both the expression and the patterns
923072b8 19 --> $DIR/match_ref_pats.rs:25:5
f20569fa
XL
20 |
21LL | / match &w {
22LL | | &Some(v) => println!("{:?}", v),
23LL | | &None => println!("none"),
24LL | | }
25 | |_____^
26 |
27help: try
28 |
94222f64
XL
29LL ~ match w {
30LL ~ Some(v) => println!("{:?}", v),
31LL ~ None => println!("none"),
f20569fa
XL
32 |
33
cdc7bbd5 34error: redundant pattern matching, consider using `is_none()`
923072b8 35 --> $DIR/match_ref_pats.rs:37:12
cdc7bbd5
XL
36 |
37LL | 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
cdc7bbd5 42error: redundant pattern matching, consider using `is_none()`
923072b8 43 --> $DIR/match_ref_pats.rs:42:12
cdc7bbd5
XL
44 |
45LL | if let &None = &b {
46 | -------^^^^^----- help: try this: `if b.is_none()`
47
f20569fa 48error: you don't need to add `&` to all patterns
923072b8 49 --> $DIR/match_ref_pats.rs:102:9
f20569fa 50 |
3c0e092e
XL
51LL | / match foobar_variant!(0) {
52LL | | &FooBar::Foo => println!("Foo"),
53LL | | &FooBar::Bar => println!("Bar"),
54LL | | &FooBar::FooBar => println!("FooBar"),
f20569fa
XL
55LL | | _ => println!("Wild"),
56LL | | }
57 | |_________^
58 |
59help: instead of prefixing all patterns with `&`, you can dereference the expression
60 |
3c0e092e
XL
61LL ~ match *foobar_variant!(0) {
62LL ~ FooBar::Foo => println!("Foo"),
63LL ~ FooBar::Bar => println!("Bar"),
64LL ~ FooBar::FooBar => println!("FooBar"),
f20569fa
XL
65 |
66
3c0e092e 67error: aborting due to 5 previous errors
f20569fa 68