-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #80104 - Nadrieril:usefulness-merging, r=varkor
Improve and fix diagnostics of exhaustiveness checking Primarily, this fixes #56379. This also fixes incorrect interactions between or-patterns and slice patterns that I discovered while working on #56379. Those two examples show the incorrect diagnostics: ```rust match &[][..] { [true] => {} [true // detected as unreachable but that's not true | false, ..] => {} _ => {} } match (true, None) { (true, Some(_)) => {} (false, Some(true)) => {} (true | false, None | Some(true // should be detected as unreachable | false)) => {} } ``` I did not measure any perf impact. However, I suspect that [`616ba9f`](616ba9f) should have a negative impact on large or-patterns. I'll see what the perf run says; I have optimization ideas up my sleeve if needed. EDIT: I initially had a noticeable perf impact that I thought unavoidable. I then proceeded to avoid it x) r? `@varkor` `@rustbot` label +A-exhaustiveness-checking
- Loading branch information
Showing
12 changed files
with
286 additions
and
139 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.