-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
format_args!
does not respect integer literals' type
#115423
Comments
I went and looked through the |
@rustbot claim |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-medium |
Did run a bisection on the reproducible provided (and duplicated #116631) Regression in nightly-2023-04-22, specifically I think commit 8bdcc62 or (as pointed out in PR #116633) #106824 found 11 bors merge commits in the specified range cc @m-ou-se |
Looks like it's not easy invoke the same integer-literal-range-checking code from the place where format_args!() is expanded. So the easiest solution is probably to expand to something like |
Actually, looks like there is a much easier fix that mostly just involves removing code. ^^' Will send a PR soon, probably tomorrow. |
Fix: #118659 |
Don't inline integer literals when they overflow - new attempt Basically rust-lang#116633 but I implemented the suggested changes. Fixes rust-lang#115423. Fixes rust-lang#116631. This is my first contribution to this repo so please let me know if I'm supposed to change something :)
Don't inline integer literals when they overflow - new attempt Basically rust-lang#116633 but I implemented the suggested changes. Fixes rust-lang#115423. Fixes rust-lang#116631. This is my first contribution to this repo so please let me know if I'm supposed to change something :)
Rollup merge of rust-lang#123935 - tstsrt:fix-115423, r=oli-obk Don't inline integer literals when they overflow - new attempt Basically rust-lang#116633 but I implemented the suggested changes. Fixes rust-lang#115423. Fixes rust-lang#116631. This is my first contribution to this repo so please let me know if I'm supposed to change something :)
When using the
1234i8
syntax in the Display format in formatting macros, thei8
is ignored and treated as au128
.I tried this code:
I expected to see this happen: Getting an error that
0x8F
is out of the bounds for typei8
.Instead, this happened: This function compiles and prints
143
.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: