Skip to content

Commit

Permalink
Add unbounded pats to match_overlapping_arm tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Wright committed Oct 15, 2021
1 parent e664a76 commit 28a249b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
11 changes: 4 additions & 7 deletions tests/ui/match_overlapping_arm.rs
Expand Up @@ -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
Expand Down
14 changes: 13 additions & 1 deletion tests/ui/match_overlapping_arm.stderr
Expand Up @@ -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

0 comments on commit 28a249b

Please sign in to comment.