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() {
69
69
_ => ( ) ,
70
70
}
71
71
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
+
72
90
/*
73
91
// FIXME(JohnTitor): uncomment this once rustfmt knows half-open patterns
74
92
match 42 {
Original file line number Diff line number Diff line change @@ -35,5 +35,29 @@ note: overlaps with this
35
35
LL | 0..=11 => println!("0 ... 11"),
36
36
| ^^^^^^
37
37
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
39
63
You can’t perform that action at this time.
0 commit comments