Skip to content

Fix #[expect(dead_code)] liveness propagation#154377

Open
mu001999 wants to merge 1 commit intorust-lang:mainfrom
mu001999-contrib:fix/dead-code
Open

Fix #[expect(dead_code)] liveness propagation#154377
mu001999 wants to merge 1 commit intorust-lang:mainfrom
mu001999-contrib:fix/dead-code

Conversation

@mu001999
Copy link
Contributor

Fixes #154324
Fixes #152370 (cc @eggyal)

Previously, when traversing from a ComesFromAllowExpect::Yes item (i.e., with #[allow(dead_code)] or #[expect(dead_code)]), other ComesFromAllowExpect::Yes items reached during propagation would be updated to ComesFromAllowExpect::No and inserted into live_symbols. That caused dead_code lint couldn't be emitted correctly.

After this PR, ComesFromAllowExpect::Yes items no longer incorrectly update other ComesFromAllowExpect::Yes items during propagation or mark them live by mistake, then dead_code lint could behave as expected.

@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. labels Mar 25, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 25, 2026

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 12 candidates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

3 participants