-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
overflowing_literals
error not triggered in format_args
for integer literal with default formatting
#116631
Labels
A-fmt
Area: `std::fmt`
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
tstsrt
added
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Oct 11, 2023
rustbot
added
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Oct 11, 2023
@rustbot claim |
Probably a regression caused by the recent change that bakes literals straight into the format string. |
agluszak
added a commit
to agluszak/rust
that referenced
this issue
Oct 11, 2023
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Oct 11, 2023
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.
fmease
added
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
A-fmt
Area: `std::fmt`
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
and removed
A-diagnostics
Area: Messages for errors, warnings, and lints
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
Oct 11, 2023
rustbot
added
the
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
label
Oct 11, 2023
This is a duplicate of #115423. |
ok @lukas-code thanks! Closing as duplicate: also bisection of this issue and of #115423 lead to the same group of PRs. |
apiraino
removed
the
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
label
Oct 11, 2023
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Apr 18, 2024
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 :)
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this issue
Apr 18, 2024
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 :)
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this issue
Apr 19, 2024
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 :)
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Apr 19, 2024
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 :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-fmt
Area: `std::fmt`
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
No error, program compiles and prints `4294967295`
Desired output
Rationale and extra context
No response
Other cases
Anything else?
Error occurs on stable (1.73) and nightly (1.75.0 2023-10-09)
Clippy catches this error correctly, but not rustc itself.
I had a look at the HIR output and the bug seems to occur when the literal is compile-time formatted to a static str. This erases its type and prevents type checking.
Also, this is my first issue, so please let me know if any changes are desired.
The text was updated successfully, but these errors were encountered: