]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/tests/ui/match_ref_pats.stderr
Rollup merge of #84221 - ABouttefeux:generic-arg-elision, r=estebank
[rust.git] / src / tools / clippy / tests / ui / match_ref_pats.stderr
index 52cb4a14b72bcecce5de2cf219fc616ccfa2e7b6..67474e65cde4fb2f1fedfb64bcc5bedcc86684af 100644 (file)
@@ -46,6 +46,14 @@ LL |         Some(v) => println!("{:?}", v),
 LL |         None => println!("none"),
    |
 
+error: redundant pattern matching, consider using `is_none()`
+  --> $DIR/match_ref_pats.rs:35:12
+   |
+LL |     if let &None = a {
+   |     -------^^^^^---- help: try this: `if a.is_none()`
+   |
+   = note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
+
 error: you don't need to add `&` to all patterns
   --> $DIR/match_ref_pats.rs:35:5
    |
@@ -59,6 +67,12 @@ help: instead of prefixing all patterns with `&`, you can dereference the expres
 LL |     if let None = *a {
    |            ^^^^   ^^
 
+error: redundant pattern matching, consider using `is_none()`
+  --> $DIR/match_ref_pats.rs:40:12
+   |
+LL |     if let &None = &b {
+   |     -------^^^^^----- help: try this: `if b.is_none()`
+
 error: you don't need to add `&` to both the expression and the patterns
   --> $DIR/match_ref_pats.rs:40:5
    |
@@ -87,5 +101,5 @@ LL |         match *foo_variant!(0) {
 LL |             Foo::A => println!("A"),
    |
 
-error: aborting due to 6 previous errors
+error: aborting due to 8 previous errors