-
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
dead_code lint wrongly warns about "never used" functions that are, in fact used #126289
Labels
A-lint
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
glandium
added
C-bug
Category: This is a bug.
regression-untriaged
Untriaged performance or correctness regression.
labels
Jun 12, 2024
rustbot
added
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
Jun 12, 2024
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-medium |
rustbot
added
P-medium
Medium priority
and removed
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
labels
Jun 12, 2024
apiraino
added
the
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
label
Jun 12, 2024
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. |
jieyouxu
added
L-dead_code
Lint: dead_code
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
and removed
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
Jun 12, 2024
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-lint
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.
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: