Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use min_exhaustive_patterns in core & std #122255

Merged
merged 1 commit into from Mar 13, 2024

Conversation

Nadrieril
Copy link
Member

min_exhaustive_patterns provides a subset of the functionality of exhaustive_patterns which is likely to be stabilized much earlier than the full feature.

The subset covers all the compiler and std use cases. compiler/ already uses it; this PR switches std over.

@Nadrieril Nadrieril added the F-exhaustive_patterns `#![feature(exhaustive_patterns)]` label Mar 9, 2024
@rustbot
Copy link
Collaborator

rustbot commented Mar 9, 2024

r? @scottmcm

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

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

This comment has been minimized.

@Nadrieril
Copy link
Member Author

Nadrieril commented Mar 9, 2024

Oh, I claimed too much 🙈. Welp, not much I can do, will come back to this with never_patterns probably

(note for the curious and my future self: with panic = "abort", PoisonError<T> is uninhabited and some std code matches on it under a reference, which is not part of what min_exhaustive_patterns allows).

@Nadrieril Nadrieril closed this Mar 9, 2024
@Nadrieril Nadrieril deleted the min_exh_pats-libs branch March 9, 2024 21:16
@scottmcm
Copy link
Member

@Nadrieril I'm a big fan of using the weaker, stabilization-track feature in std. I'd happily r+ this if you re-open and update it to add the TryLockError::Poisoned(never) => match never {}, arms in the 4 places.

@Nadrieril Nadrieril restored the min_exh_pats-libs branch March 12, 2024 07:13
@Nadrieril
Copy link
Member Author

Ok! Let's see if that's the only place that needs that.

r? @scottmcm

@Nadrieril Nadrieril reopened this Mar 12, 2024
@rustbot
Copy link
Collaborator

rustbot commented Mar 12, 2024

Could not assign reviewer from: scottmcm.
User(s) scottmcm are either the PR author, already assigned, or on vacation, and there are no other candidates.
Use r? to specify someone else to assign.

@Nadrieril
Copy link
Member Author

Ci passed! :)

@scottmcm
Copy link
Member

Yay!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 12, 2024

📌 Commit 9962a01 has been approved by scottmcm

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 Mar 12, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 13, 2024
…ttmcm

Use `min_exhaustive_patterns` in core & std

[`min_exhaustive_patterns`](rust-lang#119612) provides a subset of the functionality of [`exhaustive_patterns`](rust-lang#51085) which is likely to be stabilized much earlier than the full feature.

The subset covers all the compiler and std use cases. `compiler/` [already uses it](rust-lang@9dd6eda); this PR switches `std` over.
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 13, 2024
…iaskrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#121820 (pattern analysis: Store field indices in `DeconstructedPat` to avoid virtual wildcards)
 - rust-lang#121908 (match lowering: don't collect test alternatives ahead of time)
 - rust-lang#122203 (Add `intrinsic_name` to get plain intrinsic name)
 - rust-lang#122226 (coverage: Remove or migrate all unstable values of `-Cinstrument-coverage`)
 - rust-lang#122255 (Use `min_exhaustive_patterns` in core & std)
 - rust-lang#122360 ( Don't Create `ParamCandidate` When Obligation Contains Errors )
 - rust-lang#122375 (CFI: Break tests into smaller files)
 - rust-lang#122383 (Enable PR tracking review assignment for rust-lang/rust)
 - rust-lang#122386 (Move `Once` implementations to `sys`)
 - rust-lang#122400 (Fix ICE in diagnostics for parenthesized type arguments)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 13, 2024
…iaskrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#121820 (pattern analysis: Store field indices in `DeconstructedPat` to avoid virtual wildcards)
 - rust-lang#121908 (match lowering: don't collect test alternatives ahead of time)
 - rust-lang#122203 (Add `intrinsic_name` to get plain intrinsic name)
 - rust-lang#122226 (coverage: Remove or migrate all unstable values of `-Cinstrument-coverage`)
 - rust-lang#122255 (Use `min_exhaustive_patterns` in core & std)
 - rust-lang#122360 ( Don't Create `ParamCandidate` When Obligation Contains Errors )
 - rust-lang#122383 (Enable PR tracking review assignment for rust-lang/rust)
 - rust-lang#122386 (Move `Once` implementations to `sys`)
 - rust-lang#122400 (Fix ICE in diagnostics for parenthesized type arguments)
 - rust-lang#122410 (rustdoc: do not preload fonts when browsing locally)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e42a702 into rust-lang:master Mar 13, 2024
11 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Mar 13, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 13, 2024
Rollup merge of rust-lang#122255 - Nadrieril:min_exh_pats-libs, r=scottmcm

Use `min_exhaustive_patterns` in core & std

[`min_exhaustive_patterns`](rust-lang#119612) provides a subset of the functionality of [`exhaustive_patterns`](rust-lang#51085) which is likely to be stabilized much earlier than the full feature.

The subset covers all the compiler and std use cases. `compiler/` [already uses it](rust-lang@9dd6eda); this PR switches `std` over.
@Nadrieril Nadrieril deleted the min_exh_pats-libs branch March 13, 2024 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-exhaustive_patterns `#![feature(exhaustive_patterns)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

None yet

5 participants