Run rustfix
This commit is contained in:
parent
8be37fdb1d
commit
0b3f452764
21
tests/ui/patterns.fixed
Normal file
21
tests/ui/patterns.fixed
Normal file
@ -0,0 +1,21 @@
|
||||
// run-rustfix
|
||||
#![allow(unused)]
|
||||
#![warn(clippy::all)]
|
||||
#![feature(slice_patterns)]
|
||||
|
||||
fn main() {
|
||||
let v = Some(true);
|
||||
let s = [0, 1, 2, 3, 4];
|
||||
match v {
|
||||
Some(x) => (),
|
||||
y => (),
|
||||
}
|
||||
match v {
|
||||
Some(x) => (),
|
||||
y @ None => (), // no error
|
||||
}
|
||||
match s {
|
||||
[x, inside @ .., y] => (), // no error
|
||||
[..] => (),
|
||||
}
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
// run-rustfix
|
||||
#![allow(unused)]
|
||||
#![warn(clippy::all)]
|
||||
#![feature(slice_patterns)]
|
||||
|
@ -1,5 +1,5 @@
|
||||
error: the `y @ _` pattern can be written as just `y`
|
||||
--> $DIR/patterns.rs:10:9
|
||||
--> $DIR/patterns.rs:11:9
|
||||
|
|
||||
LL | y @ _ => (),
|
||||
| ^^^^^ help: try: `y`
|
||||
|
Loading…
Reference in New Issue
Block a user