2019-04-27 12:56:57 +01:00
|
|
|
error: literal out of range for `u8`
|
2019-01-17 09:22:52 +00:00
|
|
|
--> $DIR/deny-overflowing-literals.rs:2:17
|
2018-09-23 22:59:06 +08:00
|
|
|
|
|
|
|
|
LL | let x: u8 = 256;
|
|
|
|
| ^^^
|
|
|
|
|
|
2020-03-14 11:57:04 +08:00
|
|
|
= note: the literal `256` does not fit into the type `u8` whose range is `0..=255`
|
2022-09-18 19:55:36 +04:00
|
|
|
= note: `#[deny(overflowing_literals)]` on by default
|
2018-09-23 22:59:06 +08:00
|
|
|
|
2019-05-23 21:48:26 +01:00
|
|
|
error: range endpoint is out of range for `u8`
|
|
|
|
--> $DIR/deny-overflowing-literals.rs:5:14
|
|
|
|
|
|
|
|
|
LL | for _ in 0..256u8 {}
|
|
|
|
| ^^^^^^^^ help: use an inclusive range instead: `0..=255u8`
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
2018-09-23 22:59:06 +08:00
|
|
|
|