rust/tests/ui/lint/deny-overflowing-literals.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
534 B
Plaintext
Raw Normal View History

2019-04-27 11:56:57 +00:00
error: literal out of range for `u8`
--> $DIR/deny-overflowing-literals.rs:2:17
2018-09-23 14:59:06 +00:00
|
LL | let x: u8 = 256;
| ^^^
|
= note: the literal `256` does not fit into the type `u8` whose range is `0..=255`
2022-09-18 15:55:36 +00:00
= note: `#[deny(overflowing_literals)]` on by default
2018-09-23 14:59:06 +00: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 14:59:06 +00:00