forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#116633 - agluszak:fix-116631, r=<try>
Do not inline integer linterals which are out of range in format_args! Inlining integers (even those out of range) was introduced in rust-lang#106824. Closes rust-lang#116631.
- Loading branch information
Showing
4 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
format_args!("{}\n", 0xffff_ffff_u8); //~ ERROR literal out of range for `u8` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error: literal out of range for `u8` | ||
--> $DIR/issue-116631.rs:2:26 | ||
| | ||
LL | format_args!("{}\n", 0xffff_ffff_u8); | ||
| ^^^^^^^^^^^^^^ help: consider using the type `u32` instead: `0xffff_ffff_u32` | ||
| | ||
= note: the literal `0xffff_ffff_u8` (decimal `4294967295`) does not fit into the type `u8` and will become `255u8` | ||
= note: `#[deny(overflowing_literals)]` on by default | ||
|
||
error: aborting due to previous error | ||
|