File tree 2 files changed +17
-8
lines changed
2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -88,20 +88,17 @@ fn overlapping() {
88
88
_ => ( ) ,
89
89
}
90
90
91
- /*
92
- // FIXME(JohnTitor): uncomment this once rustfmt knows half-open patterns
93
91
match 42 {
94
- 0 .. => println!("0 .. 42 "),
95
- 3 .. => println!("3 .. 42 "),
92
+ 3 .. => println ! ( "3.. " ) ,
93
+ 0 .. => println ! ( "0.. " ) ,
96
94
_ => ( ) ,
97
95
}
98
96
99
97
match 42 {
100
- ..=23 => println!("0 ... 23"),
101
- ..26 => println!("0 .. 26"),
98
+ ..=23 => println ! ( "..= 23" ) ,
99
+ ..26 => println ! ( ".. 26" ) ,
102
100
_ => ( ) ,
103
101
}
104
- */
105
102
106
103
if let None = Some ( 42 ) {
107
104
// nothing
Original file line number Diff line number Diff line change @@ -59,5 +59,17 @@ note: overlaps with this
59
59
LL | 0..=10 => println!("0..=10"),
60
60
| ^^^^^^
61
61
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
63
75
You can’t perform that action at this time.
0 commit comments