Skip to content

Commit 28a249b

Browse files
author
Michael Wright
committed
Add unbounded pats to match_overlapping_arm tests
1 parent e664a76 commit 28a249b

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

tests/ui/match_overlapping_arm.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,17 @@ fn overlapping() {
8888
_ => (),
8989
}
9090

91-
/*
92-
// FIXME(JohnTitor): uncomment this once rustfmt knows half-open patterns
9391
match 42 {
94-
0.. => println!("0 .. 42"),
95-
3.. => println!("3 .. 42"),
92+
3.. => println!("3.."),
93+
0.. => println!("0.."),
9694
_ => (),
9795
}
9896

9997
match 42 {
100-
..=23 => println!("0 ... 23"),
101-
..26 => println!("0 .. 26"),
98+
..=23 => println!("..=23"),
99+
..26 => println!("..26"),
102100
_ => (),
103101
}
104-
*/
105102

106103
if let None = Some(42) {
107104
// nothing

tests/ui/match_overlapping_arm.stderr

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,17 @@ note: overlaps with this
5959
LL | 0..=10 => println!("0..=10"),
6060
| ^^^^^^
6161

62-
error: aborting due to 5 previous errors
62+
error: some ranges overlap
63+
--> $DIR/match_overlapping_arm.rs:98:9
64+
|
65+
LL | ..=23 => println!("..=23"),
66+
| ^^^^^
67+
|
68+
note: overlaps with this
69+
--> $DIR/match_overlapping_arm.rs:99:9
70+
|
71+
LL | ..26 => println!("..26"),
72+
| ^^^^
73+
74+
error: aborting due to 6 previous errors
6375

0 commit comments

Comments
 (0)