For half-open ranges, specifies that the upper bound cannot be the minimum. Also specify that this only applies to range patterns and not also expressions.
78 lines
2.9 KiB
Text
78 lines
2.9 KiB
Text
error: literal out of range for `u8`
|
|
--> $DIR/validate-range-endpoints.rs:6:12
|
|
|
|
|
LL | 1..257 => {}
|
|
| ^^^ this value does not fit into the type `u8` whose range is `0..=255`
|
|
|
|
error: literal out of range for `u8`
|
|
--> $DIR/validate-range-endpoints.rs:8:13
|
|
|
|
|
LL | 1..=256 => {}
|
|
| ^^^ this value does not fit into the type `u8` whose range is `0..=255`
|
|
|
|
error[E0030]: lower bound for range pattern must be less than or equal to upper bound
|
|
--> $DIR/validate-range-endpoints.rs:17:9
|
|
|
|
|
LL | 1..=TOO_BIG => {}
|
|
| ^^^^^^^^^^^ lower bound larger than upper bound
|
|
|
|
error: literal out of range for `u64`
|
|
--> $DIR/validate-range-endpoints.rs:23:32
|
|
|
|
|
LL | 10000000000000000000..=99999999999999999999 => {}
|
|
| ^^^^^^^^^^^^^^^^^^^^ this value does not fit into the type `u64` whose range is `0..=18446744073709551615`
|
|
|
|
error: literal out of range for `i8`
|
|
--> $DIR/validate-range-endpoints.rs:29:12
|
|
|
|
|
LL | 0..129 => {}
|
|
| ^^^ this value does not fit into the type `i8` whose range is `-128..=127`
|
|
|
|
error: literal out of range for `i8`
|
|
--> $DIR/validate-range-endpoints.rs:31:13
|
|
|
|
|
LL | 0..=128 => {}
|
|
| ^^^ this value does not fit into the type `i8` whose range is `-128..=127`
|
|
|
|
error: literal out of range for `i8`
|
|
--> $DIR/validate-range-endpoints.rs:33:9
|
|
|
|
|
LL | -129..0 => {}
|
|
| ^^^^ this value does not fit into the type `i8` whose range is `-128..=127`
|
|
|
|
error: literal out of range for `i8`
|
|
--> $DIR/validate-range-endpoints.rs:35:9
|
|
|
|
|
LL | -10000..=-20 => {}
|
|
| ^^^^^^ this value does not fit into the type `i8` whose range is `-128..=127`
|
|
|
|
error[E0004]: non-exhaustive patterns: `i8::MIN..=-17_i8` and `1_i8..=i8::MAX` not covered
|
|
--> $DIR/validate-range-endpoints.rs:46:11
|
|
|
|
|
LL | match 0i8 {
|
|
| ^^^ patterns `i8::MIN..=-17_i8` and `1_i8..=i8::MAX` not covered
|
|
|
|
|
= note: the matched value is of type `i8`
|
|
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
|
|
|
|
LL ~ -10000..=0 => {},
|
|
LL + i8::MIN..=-17_i8 | 1_i8..=i8::MAX => todo!()
|
|
|
|
|
|
|
error[E0004]: non-exhaustive patterns: `i8::MIN..=-17_i8` not covered
|
|
--> $DIR/validate-range-endpoints.rs:50:11
|
|
|
|
|
LL | match 0i8 {
|
|
| ^^^ pattern `i8::MIN..=-17_i8` not covered
|
|
|
|
|
= note: the matched value is of type `i8`
|
|
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
|
|
|
|
LL ~ -10000.. => {},
|
|
LL + i8::MIN..=-17_i8 => todo!()
|
|
|
|
|
|
|
error: aborting due to 10 previous errors
|
|
|
|
Some errors have detailed explanations: E0004, E0030.
|
|
For more information about an error, try `rustc --explain E0004`.
|