mirror of https://github.com/rust-lang/rust.git
Run rustfix
This commit is contained in:
parent
8be37fdb1d
commit
0b3f452764
|
@ -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)]
|
#![allow(unused)]
|
||||||
#![warn(clippy::all)]
|
#![warn(clippy::all)]
|
||||||
#![feature(slice_patterns)]
|
#![feature(slice_patterns)]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error: the `y @ _` pattern can be written as just `y`
|
error: the `y @ _` pattern can be written as just `y`
|
||||||
--> $DIR/patterns.rs:10:9
|
--> $DIR/patterns.rs:11:9
|
||||||
|
|
|
|
||||||
LL | y @ _ => (),
|
LL | y @ _ => (),
|
||||||
| ^^^^^ help: try: `y`
|
| ^^^^^ help: try: `y`
|
||||||
|
|
Loading…
Reference in New Issue