Skip to content

Explain why we require _ for empty patterns #128033

New issue

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

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

Already on GitHub? # to your account

Merged
merged 2 commits into from
Jul 22, 2024

Conversation

Nadrieril
Copy link
Member

This adds a note to the "non-exhaustive patterns" diagnostic to explain why we sometimes require extra _ patterns on empty types. This is one of the two diagnostic improvements I wanted to do before stabilizing min_exhaustive_patterns.

r? @compiler-errors

@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 Jul 21, 2024
@compiler-errors
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jul 21, 2024

📌 Commit 8a49d83 has been approved by compiler-errors

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 Jul 21, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 21, 2024
… r=compiler-errors

Explain why we require `_` for empty patterns

This adds a note to the "non-exhaustive patterns" diagnostic to explain why we sometimes require extra `_` patterns on empty types. This is one of the two diagnostic improvements I wanted to do before [stabilizing `min_exhaustive_patterns`](rust-lang#122792).

r? `@compiler-errors`
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 21, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#127510 (Rewrite `test-float-parse` in Rust)
 - rust-lang#127583 (Deal with invalid UTF-8 from `gai_strerror`)
 - rust-lang#127977 (Update wasi-sdk in CI to latest release)
 - rust-lang#128014 (Fix stab display in doc blocks)
 - rust-lang#128020 (Just totally fully deny late-bound consts)
 - rust-lang#128023 (rustdoc: short descriptions cause word-breaks in tables)
 - rust-lang#128033 (Explain why we require `_` for empty patterns)

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

Rollup of 7 pull requests

Successful merges:

 - rust-lang#127510 (Rewrite `test-float-parse` in Rust)
 - rust-lang#127583 (Deal with invalid UTF-8 from `gai_strerror`)
 - rust-lang#127977 (Update wasi-sdk in CI to latest release)
 - rust-lang#128014 (Fix stab display in doc blocks)
 - rust-lang#128020 (Just totally fully deny late-bound consts)
 - rust-lang#128023 (rustdoc: short descriptions cause word-breaks in tables)
 - rust-lang#128033 (Explain why we require `_` for empty patterns)

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

Rollup of 6 pull requests

Successful merges:

 - rust-lang#127583 (Deal with invalid UTF-8 from `gai_strerror`)
 - rust-lang#128014 (Fix stab display in doc blocks)
 - rust-lang#128020 (Just totally fully deny late-bound consts)
 - rust-lang#128023 (rustdoc: short descriptions cause word-breaks in tables)
 - rust-lang#128033 (Explain why we require `_` for empty patterns)
 - rust-lang#128038 (Don't output incremental test artifacts into working directory)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit d484654 into rust-lang:master Jul 22, 2024
6 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Jul 22, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jul 22, 2024
Rollup merge of rust-lang#128033 - Nadrieril:explain-empty-wildcards, r=compiler-errors

Explain why we require `_` for empty patterns

This adds a note to the "non-exhaustive patterns" diagnostic to explain why we sometimes require extra `_` patterns on empty types. This is one of the two diagnostic improvements I wanted to do before [stabilizing `min_exhaustive_patterns`](rust-lang#122792).

r? ``@compiler-errors``
@Nadrieril Nadrieril deleted the explain-empty-wildcards branch July 22, 2024 06:26
# for free to join this conversation on GitHub. Already have an account? # 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.

4 participants