Add unbounded pats to match_overlapping_arm
tests
This commit is contained in:
parent
e664a76add
commit
28a249b53e
@ -88,20 +88,17 @@ fn overlapping() {
|
||||
_ => (),
|
||||
}
|
||||
|
||||
/*
|
||||
// FIXME(JohnTitor): uncomment this once rustfmt knows half-open patterns
|
||||
match 42 {
|
||||
0.. => println!("0 .. 42"),
|
||||
3.. => println!("3 .. 42"),
|
||||
3.. => println!("3.."),
|
||||
0.. => println!("0.."),
|
||||
_ => (),
|
||||
}
|
||||
|
||||
match 42 {
|
||||
..=23 => println!("0 ... 23"),
|
||||
..26 => println!("0 .. 26"),
|
||||
..=23 => println!("..=23"),
|
||||
..26 => println!("..26"),
|
||||
_ => (),
|
||||
}
|
||||
*/
|
||||
|
||||
if let None = Some(42) {
|
||||
// nothing
|
||||
|
@ -59,5 +59,17 @@ note: overlaps with this
|
||||
LL | 0..=10 => println!("0..=10"),
|
||||
| ^^^^^^
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
error: some ranges overlap
|
||||
--> $DIR/match_overlapping_arm.rs:98:9
|
||||
|
|
||||
LL | ..=23 => println!("..=23"),
|
||||
| ^^^^^
|
||||
|
|
||||
note: overlaps with this
|
||||
--> $DIR/match_overlapping_arm.rs:99:9
|
||||
|
|
||||
LL | ..26 => println!("..26"),
|
||||
| ^^^^
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user