Don't throw away unused arguments of format_args#118659
Don't throw away unused arguments of format_args#118659m-ou-se wants to merge 3 commits intorust-lang:masterfrom
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. :)