Skip to content

Improve dead code analysis#127107

Merged
bors merged 1 commit into
rust-lang:masterfrom
mu001999-contrib:dead/enhance-2
Jul 6, 2024
Merged

Improve dead code analysis#127107
bors merged 1 commit into
rust-lang:masterfrom
mu001999-contrib:dead/enhance-2

Conversation

@mu001999

Copy link
Copy Markdown
Member

Fixes #120770

  1. check impl items later if self ty is private although the trait method is public, cause we must use the ty firstly if it's private
  2. mark the adt live if it appears in pattern, like generic argument, this implies the use of the adt
  3. based on the above, we can handle the case that private adts impl Default, so that we don't need adding rustc_trivial_field_reads on Default, and the logic in should_ignore_item

r? @pnkfelix

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 29, 2024
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot

rustbot commented Jun 29, 2024

Copy link
Copy Markdown
Collaborator

rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead.

cc @rust-lang/rust-analyzer

Comment thread tests/ui/lint/dead-code/not-lint-adt-appeared-in-pattern.rs
@mu001999 mu001999 requested a review from Urgau July 4, 2024 12:37
Comment thread tests/ui/lint/dead-code/not-lint-adt-appeared-in-pattern.rs Outdated
@mu001999 mu001999 requested a review from Urgau July 4, 2024 13:36
@rust-log-analyzer

This comment has been minimized.

@pnkfelix

pnkfelix commented Jul 5, 2024

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Jul 5, 2024

Copy link
Copy Markdown
Collaborator

📌 Commit 0adb825 has been approved by pnkfelix

It is now in the queue for this repository.

@bors 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 Jul 5, 2024
@bors bors merged commit 31fe962 into rust-lang:master Jul 6, 2024
@rustbot rustbot added this to the 1.81.0 milestone Jul 6, 2024
@mu001999 mu001999 deleted the dead/enhance-2 branch July 8, 2024 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dead_code false positive introduced in rustc 1.78.0-nightly (8ace7ea1f 2024-02-07)

6 participants