diff options
| author | bors <bors@rust-lang.org> | 2020-12-19 19:14:04 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-12-19 19:14:04 +0000 |
| commit | 1f5bc176b0e54a8e464704adcd7e571700207fe9 (patch) | |
| tree | 702ff2b7019b8ed901de779f1125419b4693343e /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | 1b6b06a03a00a7c9f156bff130b72e90b79e1127 (diff) | |
| parent | cefcadbe9278cf30175e93309cdd5f1da6714869 (diff) | |
| download | rust-1f5bc176b0e54a8e464704adcd7e571700207fe9.tar.gz rust-1f5bc176b0e54a8e464704adcd7e571700207fe9.zip | |
Auto merge of #80104 - Nadrieril:usefulness-merging, r=varkor
Improve and fix diagnostics of exhaustiveness checking
Primarily, this fixes https://github.com/rust-lang/rust/issues/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`](https://github.com/rust-lang/rust/pull/80104/commits/616ba9f9f7f5845777a36e1a41a515e6c33a8776) 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
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
