rust/tests/ui/match_ref_pats.stderr
Yuri Astrakhan eb3970285b fallout: fix tests to allow uninlined_format_args
In order to switch `clippy::uninlined_format_args` from pedantic to
style, all existing tests must not raise a warning. I did not want to
change the actual tests, so this is a relatively minor change that:

* add `#![allow(clippy::uninlined_format_args)]` where needed
* normalizes all allow/deny/warn attributes
   * all allow attributes are grouped together
   * sorted alphabetically
   * the `clippy::*` attributes are listed separate from the other ones.
   * deny and warn attributes are listed before the allowed ones

changelog: none
2022-10-02 15:13:22 -04:00

69 lines
2.0 KiB
Plaintext

error: you don't need to add `&` to all patterns
--> $DIR/match_ref_pats.rs:9:9
|
LL | / match v {
LL | | &Some(v) => println!("{:?}", v),
LL | | &None => println!("none"),
LL | | }
| |_________^
|
= note: `-D clippy::match-ref-pats` implied by `-D warnings`
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
LL ~ match *v {
LL ~ Some(v) => println!("{:?}", v),
LL ~ None => println!("none"),
|
error: you don't need to add `&` to both the expression and the patterns
--> $DIR/match_ref_pats.rs:26:5
|
LL | / match &w {
LL | | &Some(v) => println!("{:?}", v),
LL | | &None => println!("none"),
LL | | }
| |_____^
|
help: try
|
LL ~ match w {
LL ~ Some(v) => println!("{:?}", v),
LL ~ None => println!("none"),
|
error: redundant pattern matching, consider using `is_none()`
--> $DIR/match_ref_pats.rs:38:12
|
LL | if let &None = a {
| -------^^^^^---- help: try this: `if a.is_none()`
|
= note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
error: redundant pattern matching, consider using `is_none()`
--> $DIR/match_ref_pats.rs:43:12
|
LL | if let &None = &b {
| -------^^^^^----- help: try this: `if b.is_none()`
error: you don't need to add `&` to all patterns
--> $DIR/match_ref_pats.rs:103:9
|
LL | / match foobar_variant!(0) {
LL | | &FooBar::Foo => println!("Foo"),
LL | | &FooBar::Bar => println!("Bar"),
LL | | &FooBar::FooBar => println!("FooBar"),
LL | | _ => println!("Wild"),
LL | | }
| |_________^
|
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
LL ~ match *foobar_variant!(0) {
LL ~ FooBar::Foo => println!("Foo"),
LL ~ FooBar::Bar => println!("Bar"),
LL ~ FooBar::FooBar => println!("FooBar"),
|
error: aborting due to 5 previous errors