This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +43
-1
lines changed Expand file tree Collapse file tree 2 files changed +43
-1
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,24 @@ fn overlapping() {
6969 _ => ( ) ,
7070 }
7171
72+ match 42 {
73+ 0 ..14 => println ! ( "0 .. 14" ) ,
74+ 5 ..10 => println ! ( "5 .. 10" ) ,
75+ _ => ( ) ,
76+ }
77+
78+ match 42 {
79+ 5 ..14 => println ! ( "5 .. 14" ) ,
80+ 0 ..=10 => println ! ( "0 ... 10" ) ,
81+ _ => ( ) ,
82+ }
83+
84+ match 42 {
85+ 0 ..7 => println ! ( "0 .. 7" ) ,
86+ 0 ..=10 => println ! ( "0 ... 10" ) ,
87+ _ => ( ) ,
88+ }
89+
7290 /*
7391 // FIXME(JohnTitor): uncomment this once rustfmt knows half-open patterns
7492 match 42 {
Original file line number Diff line number Diff line change @@ -35,5 +35,29 @@ note: overlaps with this
3535LL | 0..=11 => println!("0 ... 11"),
3636 | ^^^^^^
3737
38- error: aborting due to 3 previous errors
38+ error: some ranges overlap
39+ --> $DIR/match_overlapping_arm.rs:80:9
40+ |
41+ LL | 0..=10 => println!("0 ... 10"),
42+ | ^^^^^^
43+ |
44+ note: overlaps with this
45+ --> $DIR/match_overlapping_arm.rs:79:9
46+ |
47+ LL | 5..14 => println!("5 .. 14"),
48+ | ^^^^^
49+
50+ error: some ranges overlap
51+ --> $DIR/match_overlapping_arm.rs:85:9
52+ |
53+ LL | 0..7 => println!("0 .. 7"),
54+ | ^^^^
55+ |
56+ note: overlaps with this
57+ --> $DIR/match_overlapping_arm.rs:86:9
58+ |
59+ LL | 0..=10 => println!("0 ... 10"),
60+ | ^^^^^^
61+
62+ error: aborting due to 5 previous errors
3963
You can’t perform that action at this time.
0 commit comments