-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Don't throw away unused arguments of format_args #118659
Conversation
format_args!("{}", 12345u8) shouldn't disable the out-of-range check of the argument.
(rustbot has picked a reviewer for you, use r? to override) |
I just realized that this has a subtle bug, so don't merge this yet. :) |
Have you seen #116633? Is this a replacement of that PR? |
Ah, I didn't see that PR. Oops. That PR fixes the issue too. (It seems to be stuck though?) There's a subtle difference, and that is that with I really don't understand why overflowing literals is a lint rather than a hard error though. |
Yeah, given the T-lang approval I really wish the result is |
@rustbot author |
☔ The latest upstream changes (presumably #119324) made this pull request unmergeable. Please resolve the merge conflicts. |
Closing in favor of #116633. |
Fixes #115423
format_args!("{}", 12345u8)
was accidentally accepted, even though that literal is out of range. The literal didn't end up in the expansion offormat_args!()
, because it got simplified toformat_args!("12345")
.This change is simply to not throw away those 'inlined' arguments. This actually simplifies the code in several ways. :)