Skip to content

Emit note for non_exhaustive within defining crate for unreachable_patterns - #164362

Open
mu001999 wants to merge 1 commit into
rust-lang:mainfrom
mu001999-contrib:note-for-non-exhaustive
Open

mu001999 wants to merge 1 commit into
rust-lang:mainfrom
mu001999-contrib:note-for-non-exhaustive

Conversation

@mu001999

Copy link
Copy Markdown
Member

Original issue: #159713

Previous PR: #160918

This PR adds a note to the unreachable_patterns lint explaining that #[non_exhaustive] does not affect exhaustiveness checking within the defining crate when the type is a local enum with the attr #[non_exhaustive].

@rustbot

rustbot commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in match checking

cc @Nadrieril

@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 Oct 15, 2026
@rustbot

rustbot commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

r? @davidtwco

rustbot has assigned @davidtwco.
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 77 candidates
  • Random selection from 17 candidates

}
}

fn baz(e: E2) {

@JohnTitor JohnTitor Nov 7, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick but I guess it's also useful to add a note for ref/muts.

View changes since the review

This branch has not been deployed

No deployments
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

Development

Successfully merging this pull request may close these issues.

4 participants