Exhaustiveness: Reveal empty opaques in depth#119218
Merged
bors merged 1 commit intorust-lang:masterfrom Dec 24, 2023
Merged
Conversation
compiler-errors
approved these changes
Dec 23, 2023
compiler/rustc_middle/src/ty/inhabitedness/inhabited_predicate.rs
Outdated
Show resolved
Hide resolved
Contributor
|
r=me |
db24eea to
34307ab
Compare
Member
Author
|
@bors r=compiler-errors |
Collaborator
Collaborator
Collaborator
|
☀️ Test successful - checks-actions |
This was referenced Dec 24, 2023
Collaborator
|
Finished benchmarking commit (cdd6374): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis 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. CyclesResultsThis 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 670.739s -> 670.687s (-0.01%) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_patternsfeatures.This PR fixes this behavior by adding
InhabitedPredicate::apply_reveal_opaquethat considers opaque types when determining inhabitedness.r? @compiler-errors