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

Exhaustiveness: Reveal empty opaques in depth #119218

Merged
merged 1 commit into from
Dec 24, 2023

Conversation

Nadrieril
Copy link
Member

Follow-up to #116821. As noted there, the current implementation doesn't detect emptiness of opaques when the opaque is nested inside a type. This doesn't matter for stable behavior (which ignores nested empty types anyway) but does matter for the exhaustive_patterns/min_exhaustive_patterns features.

This PR fixes this behavior by adding InhabitedPredicate::apply_reveal_opaque that considers opaque types when determining inhabitedness.

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 Dec 22, 2023
@Nadrieril Nadrieril added the A-exhaustiveness-checking Relating to exhaustiveness / usefulness checking of patterns label Dec 22, 2023
@compiler-errors
Copy link
Member

r=me

@Nadrieril
Copy link
Member Author

@bors r=compiler-errors

@bors
Copy link
Contributor

bors commented Dec 23, 2023

📌 Commit 34307ab 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 Dec 23, 2023
@bors
Copy link
Contributor

bors commented Dec 23, 2023

⌛ Testing commit 34307ab with merge cdd6374...

@bors
Copy link
Contributor

bors commented Dec 24, 2023

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing cdd6374 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 24, 2023
@bors bors merged commit cdd6374 into rust-lang:master Dec 24, 2023
12 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Dec 24, 2023
@Nadrieril Nadrieril deleted the nested-opaque-reveal branch December 24, 2023 01:56
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (cdd6374): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.9% [2.7%, 3.5%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 670.739s -> 670.687s (-0.01%)
Artifact size: 312.78 MiB -> 312.77 MiB (-0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-exhaustiveness-checking Relating to exhaustiveness / usefulness checking of patterns merged-by-bors This PR was explicitly merged by bors. 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