mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-17 06:26:55 +00:00
Add tests
This commit is contained in:
parent
b776d1c3e3
commit
06ca6bba8d
@ -33,6 +33,12 @@ fn main() {
|
||||
m!(0u8, 25, 20..=30);
|
||||
m!(0u8, 30, 20..=30); //~ ERROR multiple patterns covering the same range
|
||||
|
||||
match 0u8 {
|
||||
0..=10 => {}
|
||||
20..=30 => {}
|
||||
10..=20 => {} //~ ERROR multiple patterns covering the same range
|
||||
_ => {}
|
||||
}
|
||||
match (0u8, true) {
|
||||
(0..=10, true) => {}
|
||||
(10..20, true) => {} // not detected
|
||||
|
@ -61,7 +61,17 @@ LL | m!(0u8, 30, 20..=30);
|
||||
| this range overlaps on `30_u8`
|
||||
|
||||
error: multiple patterns covering the same range
|
||||
--> $DIR/overlapping_range_endpoints.rs:44:16
|
||||
--> $DIR/overlapping_range_endpoints.rs:39:9
|
||||
|
|
||||
LL | 0..=10 => {}
|
||||
| ------ this range overlaps on `10_u8`
|
||||
LL | 20..=30 => {}
|
||||
| ------- this range overlaps on `20_u8`
|
||||
LL | 10..=20 => {}
|
||||
| ^^^^^^^ overlapping patterns
|
||||
|
||||
error: multiple patterns covering the same range
|
||||
--> $DIR/overlapping_range_endpoints.rs:50:16
|
||||
|
|
||||
LL | (true, 0..=10) => {}
|
||||
| ------ this range overlaps on `10_u8`
|
||||
@ -69,12 +79,12 @@ LL | (true, 10..20) => {}
|
||||
| ^^^^^^ overlapping patterns
|
||||
|
||||
error: multiple patterns covering the same range
|
||||
--> $DIR/overlapping_range_endpoints.rs:50:14
|
||||
--> $DIR/overlapping_range_endpoints.rs:56:14
|
||||
|
|
||||
LL | Some(0..=10) => {}
|
||||
| ------ this range overlaps on `10_u8`
|
||||
LL | Some(10..20) => {}
|
||||
| ^^^^^^ overlapping patterns
|
||||
|
||||
error: aborting due to 9 previous errors
|
||||
error: aborting due to 10 previous errors
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user