Skip to content

Commit 0b3f452

Browse files
committed
Run rustfix
1 parent 8be37fd commit 0b3f452

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

tests/ui/patterns.fixed

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// run-rustfix
2+
#![allow(unused)]
3+
#![warn(clippy::all)]
4+
#![feature(slice_patterns)]
5+
6+
fn main() {
7+
let v = Some(true);
8+
let s = [0, 1, 2, 3, 4];
9+
match v {
10+
Some(x) => (),
11+
y => (),
12+
}
13+
match v {
14+
Some(x) => (),
15+
y @ None => (), // no error
16+
}
17+
match s {
18+
[x, inside @ .., y] => (), // no error
19+
[..] => (),
20+
}
21+
}

tests/ui/patterns.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// run-rustfix
12
#![allow(unused)]
23
#![warn(clippy::all)]
34
#![feature(slice_patterns)]

tests/ui/patterns.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: the `y @ _` pattern can be written as just `y`
2-
--> $DIR/patterns.rs:10:9
2+
--> $DIR/patterns.rs:11:9
33
|
44
LL | y @ _ => (),
55
| ^^^^^ help: try: `y`

0 commit comments

Comments
 (0)