Skip to content

typeck: Make it clearer that check_pat_lit only handles literal patterns - #150688

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Zalathar:check-pat-lit
Feb 10, 2026
Merged

typeck: Make it clearer that check_pat_lit only handles literal patterns#150688
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Zalathar:check-pat-lit

Conversation

@Zalathar

Copy link
Copy Markdown
Member

Nowadays, the hir::PatExprKind enum guarantees that “expressions” in patterns can only be paths or literals.

PatExprKind::Path is already handled by the previous match arm, so we can make this match arm explicitly match on PatExprKind::Lit without losing exhaustiveness.

There should be no actual change to compiler behaviour.

@rustbotrustbot 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 Jan 5, 2026
@rustbot

Copy link
Copy Markdown
Collaborator

r? @SparrowLii

rustbot has assigned @SparrowLii.
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

@Zalathar

Copy link
Copy Markdown
MemberAuthor

Rerolling since Sparrow is known to be busy.

r? compiler

@petrochenkov

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@rust-bors

rust-borsBot commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 069302f has been approved by petrochenkov

It is now in the queue for this repository.

@rust-borsrust-borsBot 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 Feb 9, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 9, 2026
…nkov
typeck: Make it clearer that `check_pat_lit` only handles literal patterns
Nowadays, the `hir::PatExprKind` enum guarantees that “expressions” in patterns can only be paths or literals.
`PatExprKind::Path` is already handled by the previous match arm, so we can make this match arm explicitly match on `PatExprKind::Lit` without losing exhaustiveness.
There should be no actual change to compiler behaviour.
@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors r-
#152391 (comment)

@rust-borsrust-borsBot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 9, 2026
@rust-bors

rust-borsBot commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Commit 069302f has been unapproved.

This PR was contained in a rollup (#152391), which was also unapproved.

@rustbot

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@Zalathar

Copy link
Copy Markdown
MemberAuthor

@bors r=petrochenkov

@rust-bors

rust-borsBot commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 90fd768 has been approved by petrochenkov

It is now in the queue for this repository.

@rust-borsrust-borsBot 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 10, 2026
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 10, 2026
…nkov
typeck: Make it clearer that `check_pat_lit` only handles literal patterns
Nowadays, the `hir::PatExprKind` enum guarantees that “expressions” in patterns can only be paths or literals.
`PatExprKind::Path` is already handled by the previous match arm, so we can make this match arm explicitly match on `PatExprKind::Lit` without losing exhaustiveness.
There should be no actual change to compiler behaviour.
rust-borsBot pushed a commit that referenced this pull request Feb 10, 2026
Rollup of 7 pull requests
Successful merges:
- #151152 (Add FCW for derive helper attributes that will conflict with built-in attributes)
- #151954 (Add help message suggesting explicit reference cast for From/TryFrom)
- #152148 (Move `impl Interner for TyCtxt` to its own submodule)
- #152226 (Modernize diagnostic for indeterminate trait object lifetime bounds)
- #150688 (typeck: Make it clearer that `check_pat_lit` only handles literal patterns)
- #152293 (Format heterogeneous try blocks)
- #152396 (Uplift `Predicate::allow_normalization` to `rustc_type_ir`)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 10, 2026
…nkov
typeck: Make it clearer that `check_pat_lit` only handles literal patterns
Nowadays, the `hir::PatExprKind` enum guarantees that “expressions” in patterns can only be paths or literals.
`PatExprKind::Path` is already handled by the previous match arm, so we can make this match arm explicitly match on `PatExprKind::Lit` without losing exhaustiveness.
There should be no actual change to compiler behaviour.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 10, 2026
…nkov
typeck: Make it clearer that `check_pat_lit` only handles literal patterns
Nowadays, the `hir::PatExprKind` enum guarantees that “expressions” in patterns can only be paths or literals.
`PatExprKind::Path` is already handled by the previous match arm, so we can make this match arm explicitly match on `PatExprKind::Lit` without losing exhaustiveness.
There should be no actual change to compiler behaviour.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 10, 2026
…nkov
typeck: Make it clearer that `check_pat_lit` only handles literal patterns
Nowadays, the `hir::PatExprKind` enum guarantees that “expressions” in patterns can only be paths or literals.
`PatExprKind::Path` is already handled by the previous match arm, so we can make this match arm explicitly match on `PatExprKind::Lit` without losing exhaustiveness.
There should be no actual change to compiler behaviour.
rust-borsBot pushed a commit that referenced this pull request Feb 10, 2026
…uwer
Rollup of 11 pull requests
Successful merges:
- #152364 (Port a lot of attributes to the new parser)
- #151954 (Add help message suggesting explicit reference cast for From/TryFrom)
- #152148 (Move `impl Interner for TyCtxt` to its own submodule)
- #152226 (Modernize diagnostic for indeterminate trait object lifetime bounds)
- #152351 (Remove `SubdiagMessage` in favour of the identical `DiagMessage`)
- #152417 (Move the needs-drop check for `arena_cache` queries out of macro code)
- #150688 (typeck: Make it clearer that `check_pat_lit` only handles literal patterns)
- #152293 (Format heterogeneous try blocks)
- #152355 (Update documentation of rustc_macros)
- #152396 (Uplift `Predicate::allow_normalization` to `rustc_type_ir`)
- #152425 (Port #![test_runner] to the attribute parser)
rust-borsBot pushed a commit that referenced this pull request Feb 10, 2026
…uwer
Rollup of 10 pull requests
Successful merges:
- #152364 (Port a lot of attributes to the new parser)
- #151954 (Add help message suggesting explicit reference cast for From/TryFrom)
- #152148 (Move `impl Interner for TyCtxt` to its own submodule)
- #152226 (Modernize diagnostic for indeterminate trait object lifetime bounds)
- #152351 (Remove `SubdiagMessage` in favour of the identical `DiagMessage`)
- #152417 (Move the needs-drop check for `arena_cache` queries out of macro code)
- #150688 (typeck: Make it clearer that `check_pat_lit` only handles literal patterns)
- #152293 (Format heterogeneous try blocks)
- #152355 (Update documentation of rustc_macros)
- #152396 (Uplift `Predicate::allow_normalization` to `rustc_type_ir`)
@rust-bors
rust-borsBot merged commit b5cf352 into rust-lang:mainFeb 10, 2026
11 checks passed
@rustbotrustbot added this to the 1.95.0 milestone Feb 10, 2026
rust-timer added a commit that referenced this pull request Feb 10, 2026
Rollup merge of #150688 - Zalathar:check-pat-lit, r=petrochenkov
typeck: Make it clearer that `check_pat_lit` only handles literal patterns
Nowadays, the `hir::PatExprKind` enum guarantees that “expressions” in patterns can only be paths or literals.
`PatExprKind::Path` is already handled by the previous match arm, so we can make this match arm explicitly match on `PatExprKind::Lit` without losing exhaustiveness.
There should be no actual change to compiler behaviour.
@Zalathar
Zalathar deleted the check-pat-lit branch February 11, 2026 00:46
github-actionsBot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Feb 16, 2026
…uwer
Rollup of 10 pull requests
Successful merges:
- rust-lang/rust#152364 (Port a lot of attributes to the new parser)
- rust-lang/rust#151954 (Add help message suggesting explicit reference cast for From/TryFrom)
- rust-lang/rust#152148 (Move `impl Interner for TyCtxt` to its own submodule)
- rust-lang/rust#152226 (Modernize diagnostic for indeterminate trait object lifetime bounds)
- rust-lang/rust#152351 (Remove `SubdiagMessage` in favour of the identical `DiagMessage`)
- rust-lang/rust#152417 (Move the needs-drop check for `arena_cache` queries out of macro code)
- rust-lang/rust#150688 (typeck: Make it clearer that `check_pat_lit` only handles literal patterns)
- rust-lang/rust#152293 (Format heterogeneous try blocks)
- rust-lang/rust#152355 (Update documentation of rustc_macros)
- rust-lang/rust#152396 (Uplift `Predicate::allow_normalization` to `rustc_type_ir`)
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Aug 17, 2026
…uwer
Rollup of 10 pull requests
Successful merges:
- rust-lang/rust#152364 (Port a lot of attributes to the new parser)
- rust-lang/rust#151954 (Add help message suggesting explicit reference cast for From/TryFrom)
- rust-lang/rust#152148 (Move `impl Interner for TyCtxt` to its own submodule)
- rust-lang/rust#152226 (Modernize diagnostic for indeterminate trait object lifetime bounds)
- rust-lang/rust#152351 (Remove `SubdiagMessage` in favour of the identical `DiagMessage`)
- rust-lang/rust#152417 (Move the needs-drop check for `arena_cache` queries out of macro code)
- rust-lang/rust#150688 (typeck: Make it clearer that `check_pat_lit` only handles literal patterns)
- rust-lang/rust#152293 (Format heterogeneous try blocks)
- rust-lang/rust#152355 (Update documentation of rustc_macros)
- rust-lang/rust#152396 (Uplift `Predicate::allow_normalization` to `rustc_type_ir`)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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.

5 participants

@Zalathar@rustbot@petrochenkov@JonathanBrouwer@SparrowLii