Skip to content

Conversation

@Zalathar
Copy link
Member

@Zalathar Zalathar commented Jan 5, 2026

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.

@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 Jan 5, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 5, 2026

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
Member Author

Zalathar commented Feb 6, 2026

Rerolling since Sparrow is known to be busy.

r? compiler

@rustbot rustbot assigned petrochenkov and unassigned SparrowLii Feb 6, 2026
@petrochenkov
Copy link
Contributor

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 9, 2026

📌 Commit 069302f has been approved by petrochenkov

It is now in the queue for this repository.

@rust-bors rust-bors bot 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
Contributor

@bors r-
#152391 (comment)

@rust-bors rust-bors bot 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
Copy link
Contributor

rust-bors bot commented Feb 9, 2026

Commit 069302f has been unapproved.

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

@rustbot
Copy link
Collaborator

rustbot commented Feb 10, 2026

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
Member Author

@bors r=petrochenkov

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 10, 2026

📌 Commit 90fd768 has been approved by petrochenkov

It is now in the queue for this repository.

@rust-bors rust-bors bot 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-bors bot 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-bors bot 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-bors bot 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-bors bot merged commit b5cf352 into rust-lang:main Feb 10, 2026
11 checks passed
@rustbot rustbot 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.
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants