-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Function only used in const assert is treated as dead code #142104
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
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
L-dead_code
Lint: dead_code
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
Constants with the name |
Some previous discussion in #142075 |
I swear, myself and @clarfonthey are completely different people. |
tgross35
added a commit
to tgross35/compiler-builtins
that referenced
this issue
Jun 9, 2025
Always consider `const _` items as live for dead code analysis This PR alters dead code analysis to always consider `const _: () = { ... };` to be live. This doesn't address the `_name` pattern from rust-lang/rust#142075. Fixes rust-lang/rust#142104
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this issue
Jun 10, 2025
Always consider `const _` items as live for dead code analysis This PR alters dead code analysis to always consider `const _: () = { ... };` to be live. This doesn't address the `_name` pattern from rust-lang/rust#142075. Fixes rust-lang/rust#142104
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
L-dead_code
Lint: dead_code
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Uh oh!
There was an error while loading. Please reload this page.
I tried this code: playground link
I expected to compile without any warnings.
Instead, it indicates that
is_nonzero
is dead code:Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: