-
Notifications
You must be signed in to change notification settings - Fork 13.4k
dead_code lint wrongly warns about "never used" functions that are, in fact used #126289
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # 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.
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
L-dead_code
Lint: dead_code
P-medium
Medium priority
regression-untriaged
Untriaged performance or correctness regression.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-medium |
bisected to rust-lang-ci@c137109 cc @mu001999 |
like #126169 |
#126169 is about the struct itself, and there's a allow(unused). This is about the side effects. |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Jun 13, 2024
…rochenkov Add pub struct with allow(dead_code) into worklist <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> --> Fixes rust-lang#126289
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Jun 13, 2024
…rochenkov Add pub struct with allow(dead_code) into worklist <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> --> Fixes rust-lang#126289
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Jun 13, 2024
…rochenkov Add pub struct with allow(dead_code) into worklist <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> --> Fixes rust-lang#126289
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Jun 14, 2024
Rollup merge of rust-lang#126315 - mu001999-contrib:fix/126289, r=petrochenkov Add pub struct with allow(dead_code) into worklist <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> --> Fixes rust-lang#126289
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
L-dead_code
Lint: dead_code
P-medium
Medium priority
regression-untriaged
Untriaged performance or correctness regression.
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.
Code
Output with 1.79.0:
nothing
Output with 1.80.0:
The original code didn't have the
#[allow(unused)]
, which was added because of the "never constructed" dead_code lint, which I guess would be #126169. Adding a constructor does make the function never used errors go away, so it seems#[allow(unused)]
doesn't have enough power.The text was updated successfully, but these errors were encountered: