Extend rules of dead code analysis for impls for adts to impls for types refer to adts by mu001999 · Pull Request #127017 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation5 Commits1 Checks6 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
The rules of dead code analysis for impl blocks can be extended to self types which refer to adts.
So that we can lint the following unused struct and trait:
struct Foo; //~ ERROR struct Foo
is never constructed
trait Trait { //~ ERROR trait Trait
is never used
fn foo(&self) {}
}
impl Trait for &Foo {}
r? @pnkfelix
rustbot added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
📌 Commit 8449d10 has been approved by pnkfelix
It is now in the queue for this repository.
bors added S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
bors added a commit to rust-lang-ci/rust that referenced this pull request
Rollup of 7 pull requests
Successful merges:
- rust-lang#126575 (Make it crystal clear what lint
type_alias_bounds
actually signifies) - rust-lang#127017 (Extend rules of dead code analysis for impls for adts to impls for types refer to adts)
- rust-lang#127523 (Migrate
dump-ice-to-disk
andpanic-abort-eh_frame
run-make
tests to rmake) - rust-lang#127557 (Add a label to point to the lacking macro name definition)
- rust-lang#127989 (Migrate
interdependent-c-libraries
,compiler-rt-works-on-mingw
andincr-foreign-head-span
run-make
tests to rmake) - rust-lang#128099 (migrate tests/run-make/extern-flag-disambiguates to rmake)
- rust-lang#128170 (Make Clone::clone a lang item)
r? @ghost
@rustbot
modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Rollup merge of rust-lang#127017 - mu001999-contrib:dead/enhance, r=pnkfelix
Extend rules of dead code analysis for impls for adts to impls for types refer to adts
The rules of dead code analysis for impl blocks can be extended to self types which refer to adts.
So that we can lint the following unused struct and trait:
struct Foo; //~ ERROR struct `Foo` is never constructed
trait Trait { //~ ERROR trait `Trait` is never used
fn foo(&self) {}
}
impl Trait for &Foo {}
r? @pnkfelix
compiler-errors added a commit to compiler-errors/rust that referenced this pull request
…nce, r=pnkfelix"
This reverts commit a70dc29, reversing changes made to ceae371.
compiler-errors added a commit to compiler-errors/rust that referenced this pull request
…nce, r=pnkfelix"
This reverts commit a70dc29, reversing changes made to ceae371.
compiler-errors added a commit to compiler-errors/rust that referenced this pull request
…nce, r=pnkfelix"
This reverts commit a70dc29, reversing changes made to ceae371.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
…hanges, r=pnkfelix
Revert recent changes to dead code analysis
This is a revert to recent changes to dead code analysis, namely:
- efdf219 Rollup merge of rust-lang#128104 - mu001999-contrib:fix/128053, r=petrochenkov
- a70dc29 Rollup merge of rust-lang#127017 - mu001999-contrib:dead/enhance, r=pnkfelix
- 31fe962 Rollup merge of rust-lang#127107 - mu001999-contrib:dead/enhance-2, r=pnkfelix
- 2724aea Rollup merge of rust-lang#126618 - mu001999-contrib:dead/enhance, r=pnkfelix
- 977c5fd Rollup merge of rust-lang#126315 - mu001999-contrib:fix/126289, r=petrochenkov
- 13314df Rollup merge of rust-lang#125572 - mu001999-contrib:dead/enhance, r=pnkfelix
There is an additional change stacked on top, which suppresses false-negatives that were masked by this work. I believe the functions that are touched in that code are legitimately unused functions and the types are not reachable since this AnonPipe
type is not publically reachable -- please correct me if I'm wrong cc @NobodyXu
who added these in #rust-lang#127153.
Some of these reverts (rust-lang#126315 and rust-lang#126618) are only included because it makes the revert apply cleanly, and I think these changes were only done to fix follow-ups from the other PRs?
I apologize for the size of the PR and the churn that it has on the codebase (and for reverting @mu001999's
work here), but I'm putting this PR up because I am concerned that we're making ad-hoc changes to fix bugs that are fallout of these PRs, and I'd like to see these changes reimplemented in a way that's more separable from the existing dead code pass. I am happy to review any code to reapply these changes in a more separable way.
cc @mu001999
r? @pnkfelix
Fixes rust-lang#128272 Fixes rust-lang#126169
tgross35 added a commit to tgross35/rust that referenced this pull request
…hanges, r=pnkfelix
Revert recent changes to dead code analysis
This is a revert to recent changes to dead code analysis, namely:
- efdf219 Rollup merge of rust-lang#128104 - mu001999-contrib:fix/128053, r=petrochenkov
- a70dc29 Rollup merge of rust-lang#127017 - mu001999-contrib:dead/enhance, r=pnkfelix
- 31fe962 Rollup merge of rust-lang#127107 - mu001999-contrib:dead/enhance-2, r=pnkfelix
- 2724aea Rollup merge of rust-lang#126618 - mu001999-contrib:dead/enhance, r=pnkfelix
- 977c5fd Rollup merge of rust-lang#126315 - mu001999-contrib:fix/126289, r=petrochenkov
- 13314df Rollup merge of rust-lang#125572 - mu001999-contrib:dead/enhance, r=pnkfelix
There is an additional change stacked on top, which suppresses false-negatives that were masked by this work. I believe the functions that are touched in that code are legitimately unused functions and the types are not reachable since this AnonPipe
type is not publically reachable -- please correct me if I'm wrong cc @NobodyXu
who added these in #rust-lang#127153.
Some of these reverts (rust-lang#126315 and rust-lang#126618) are only included because it makes the revert apply cleanly, and I think these changes were only done to fix follow-ups from the other PRs?
I apologize for the size of the PR and the churn that it has on the codebase (and for reverting @mu001999's
work here), but I'm putting this PR up because I am concerned that we're making ad-hoc changes to fix bugs that are fallout of these PRs, and I'd like to see these changes reimplemented in a way that's more separable from the existing dead code pass. I am happy to review any code to reapply these changes in a more separable way.
cc @mu001999
r? @pnkfelix
Fixes rust-lang#128272 Fixes rust-lang#126169
compiler-errors added a commit to compiler-errors/rust that referenced this pull request
…nce, r=pnkfelix"
This reverts commit a70dc29, reversing changes made to ceae371.
tgross35 added a commit to tgross35/rust that referenced this pull request
…hanges, r=pnkfelix
Revert recent changes to dead code analysis
This is a revert to recent changes to dead code analysis, namely:
- efdf219 Rollup merge of rust-lang#128104 - mu001999-contrib:fix/128053, r=petrochenkov
- a70dc29 Rollup merge of rust-lang#127017 - mu001999-contrib:dead/enhance, r=pnkfelix
- 31fe962 Rollup merge of rust-lang#127107 - mu001999-contrib:dead/enhance-2, r=pnkfelix
- 2724aea Rollup merge of rust-lang#126618 - mu001999-contrib:dead/enhance, r=pnkfelix
- 977c5fd Rollup merge of rust-lang#126315 - mu001999-contrib:fix/126289, r=petrochenkov
- 13314df Rollup merge of rust-lang#125572 - mu001999-contrib:dead/enhance, r=pnkfelix
There is an additional change stacked on top, which suppresses false-negatives that were masked by this work. I believe the functions that are touched in that code are legitimately unused functions and the types are not reachable since this AnonPipe
type is not publically reachable -- please correct me if I'm wrong cc @NobodyXu
who added these in #rust-lang#127153.
Some of these reverts (rust-lang#126315 and rust-lang#126618) are only included because it makes the revert apply cleanly, and I think these changes were only done to fix follow-ups from the other PRs?
I apologize for the size of the PR and the churn that it has on the codebase (and for reverting @mu001999's
work here), but I'm putting this PR up because I am concerned that we're making ad-hoc changes to fix bugs that are fallout of these PRs, and I'd like to see these changes reimplemented in a way that's more separable from the existing dead code pass. I am happy to review any code to reapply these changes in a more separable way.
cc @mu001999
r? @pnkfelix
Fixes rust-lang#128272 Fixes rust-lang#126169
jieyouxu added a commit to jieyouxu/rust that referenced this pull request
…hanges, r=pnkfelix
Revert recent changes to dead code analysis
This is a revert to recent changes to dead code analysis, namely:
- efdf219 Rollup merge of rust-lang#128104 - mu001999-contrib:fix/128053, r=petrochenkov
- a70dc29 Rollup merge of rust-lang#127017 - mu001999-contrib:dead/enhance, r=pnkfelix
- 31fe962 Rollup merge of rust-lang#127107 - mu001999-contrib:dead/enhance-2, r=pnkfelix
- 2724aea Rollup merge of rust-lang#126618 - mu001999-contrib:dead/enhance, r=pnkfelix
- 977c5fd Rollup merge of rust-lang#126315 - mu001999-contrib:fix/126289, r=petrochenkov
- 13314df Rollup merge of rust-lang#125572 - mu001999-contrib:dead/enhance, r=pnkfelix
There is an additional change stacked on top, which suppresses false-negatives that were masked by this work. I believe the functions that are touched in that code are legitimately unused functions and the types are not reachable since this AnonPipe
type is not publically reachable -- please correct me if I'm wrong cc @NobodyXu
who added these in #rust-lang#127153.
Some of these reverts (rust-lang#126315 and rust-lang#126618) are only included because it makes the revert apply cleanly, and I think these changes were only done to fix follow-ups from the other PRs?
I apologize for the size of the PR and the churn that it has on the codebase (and for reverting @mu001999's
work here), but I'm putting this PR up because I am concerned that we're making ad-hoc changes to fix bugs that are fallout of these PRs, and I'd like to see these changes reimplemented in a way that's more separable from the existing dead code pass. I am happy to review any code to reapply these changes in a more separable way.
cc @mu001999
r? @pnkfelix
Fixes rust-lang#128272 Fixes rust-lang#126169
jieyouxu added a commit to jieyouxu/rust that referenced this pull request
…hanges, r=pnkfelix
Revert recent changes to dead code analysis
This is a revert to recent changes to dead code analysis, namely:
- efdf219 Rollup merge of rust-lang#128104 - mu001999-contrib:fix/128053, r=petrochenkov
- a70dc29 Rollup merge of rust-lang#127017 - mu001999-contrib:dead/enhance, r=pnkfelix
- 31fe962 Rollup merge of rust-lang#127107 - mu001999-contrib:dead/enhance-2, r=pnkfelix
- 2724aea Rollup merge of rust-lang#126618 - mu001999-contrib:dead/enhance, r=pnkfelix
- 977c5fd Rollup merge of rust-lang#126315 - mu001999-contrib:fix/126289, r=petrochenkov
- 13314df Rollup merge of rust-lang#125572 - mu001999-contrib:dead/enhance, r=pnkfelix
There is an additional change stacked on top, which suppresses false-negatives that were masked by this work. I believe the functions that are touched in that code are legitimately unused functions and the types are not reachable since this AnonPipe
type is not publically reachable -- please correct me if I'm wrong cc @NobodyXu
who added these in #rust-lang#127153.
Some of these reverts (rust-lang#126315 and rust-lang#126618) are only included because it makes the revert apply cleanly, and I think these changes were only done to fix follow-ups from the other PRs?
I apologize for the size of the PR and the churn that it has on the codebase (and for reverting @mu001999's
work here), but I'm putting this PR up because I am concerned that we're making ad-hoc changes to fix bugs that are fallout of these PRs, and I'd like to see these changes reimplemented in a way that's more separable from the existing dead code pass. I am happy to review any code to reapply these changes in a more separable way.
cc @mu001999
r? @pnkfelix
Fixes rust-lang#128272 Fixes rust-lang#126169
jieyouxu added a commit to jieyouxu/rust that referenced this pull request
…hanges, r=pnkfelix
Revert recent changes to dead code analysis
This is a revert to recent changes to dead code analysis, namely:
- efdf219 Rollup merge of rust-lang#128104 - mu001999-contrib:fix/128053, r=petrochenkov
- a70dc29 Rollup merge of rust-lang#127017 - mu001999-contrib:dead/enhance, r=pnkfelix
- 31fe962 Rollup merge of rust-lang#127107 - mu001999-contrib:dead/enhance-2, r=pnkfelix
- 2724aea Rollup merge of rust-lang#126618 - mu001999-contrib:dead/enhance, r=pnkfelix
- 977c5fd Rollup merge of rust-lang#126315 - mu001999-contrib:fix/126289, r=petrochenkov
- 13314df Rollup merge of rust-lang#125572 - mu001999-contrib:dead/enhance, r=pnkfelix
There is an additional change stacked on top, which suppresses false-negatives that were masked by this work. I believe the functions that are touched in that code are legitimately unused functions and the types are not reachable since this AnonPipe
type is not publically reachable -- please correct me if I'm wrong cc @NobodyXu
who added these in #rust-lang#127153.
Some of these reverts (rust-lang#126315 and rust-lang#126618) are only included because it makes the revert apply cleanly, and I think these changes were only done to fix follow-ups from the other PRs?
I apologize for the size of the PR and the churn that it has on the codebase (and for reverting @mu001999's
work here), but I'm putting this PR up because I am concerned that we're making ad-hoc changes to fix bugs that are fallout of these PRs, and I'd like to see these changes reimplemented in a way that's more separable from the existing dead code pass. I am happy to review any code to reapply these changes in a more separable way.
cc @mu001999
r? @pnkfelix
Fixes rust-lang#128272 Fixes rust-lang#126169
compiler-errors added a commit to compiler-errors/rust that referenced this pull request
…nce, r=pnkfelix"
This reverts commit a70dc29, reversing changes made to ceae371.
bors added a commit to rust-lang-ci/rust that referenced this pull request
…nges, r=pnkfelix
Revert recent changes to dead code analysis
This is a revert to recent changes to dead code analysis, namely:
- efdf219 Rollup merge of rust-lang#128104 - mu001999-contrib:fix/128053, r=petrochenkov
- a70dc29 Rollup merge of rust-lang#127017 - mu001999-contrib:dead/enhance, r=pnkfelix
- 31fe962 Rollup merge of rust-lang#127107 - mu001999-contrib:dead/enhance-2, r=pnkfelix
- 2724aea Rollup merge of rust-lang#126618 - mu001999-contrib:dead/enhance, r=pnkfelix
- 977c5fd Rollup merge of rust-lang#126315 - mu001999-contrib:fix/126289, r=petrochenkov
- 13314df Rollup merge of rust-lang#125572 - mu001999-contrib:dead/enhance, r=pnkfelix
There is an additional change stacked on top, which suppresses false-negatives that were masked by this work. I believe the functions that are touched in that code are legitimately unused functions and the types are not reachable since this AnonPipe
type is not publically reachable -- please correct me if I'm wrong cc @NobodyXu
who added these in #rust-lang#127153.
Some of these reverts (rust-lang#126315 and rust-lang#126618) are only included because it makes the revert apply cleanly, and I think these changes were only done to fix follow-ups from the other PRs?
I apologize for the size of the PR and the churn that it has on the codebase (and for reverting @mu001999's
work here), but I'm putting this PR up because I am concerned that we're making ad-hoc changes to fix bugs that are fallout of these PRs, and I'd like to see these changes reimplemented in a way that's more separable from the existing dead code pass. I am happy to review any code to reapply these changes in a more separable way.
cc @mu001999
r? @pnkfelix
Fixes rust-lang#128272 Fixes rust-lang#126169
Labels
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the compiler team, which will review and decide on the PR/issue.