rust/tests/ui/or-patterns
bors ee80c8d0a8 Auto merge of #117611 - Nadrieril:linear-pass-take-4, r=cjgillot
Rewrite exhaustiveness in one pass

This is at least my 4th attempt at this in as many years x) Previous attempts were all too complicated or too slow. But we're finally here!

The previous version of the exhaustiveness algorithm computed reachability for each arm then exhaustiveness of the whole match. Since each of these steps does roughly the same things, this rewrites the algorithm to do them all in one go. I also think this makes things much simpler.

I also rewrote the documentation of the algorithm in depth. Hopefully it's up-to-date and easier to follow now. Plz comment if anything's unclear.

r? `@oli-obk` I think you're one of the rare other people to understand the exhaustiveness algorithm?

cc `@varkor` I know you're not active anymore, but if you feel like having a look you might enjoy this :D

Fixes https://github.com/rust-lang/rust/issues/79307
2023-11-26 00:14:14 +00:00
..
already-bound-name.rs
already-bound-name.stderr Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
basic-switch.rs
basic-switchint.rs
bindings-runpass-1.rs
bindings-runpass-2.rs
box-patterns.rs
consistent-bindings.rs
const-fn.rs
exhaustiveness-non-exhaustive.rs
exhaustiveness-non-exhaustive.stderr Perform match checking on THIR. 2023-04-03 15:59:21 +00:00
exhaustiveness-pass.rs Add some tests 2023-11-22 02:14:42 +01:00
exhaustiveness-unreachable-pattern.rs Add some tests 2023-11-22 02:14:42 +01:00
exhaustiveness-unreachable-pattern.stderr Add some tests 2023-11-22 02:14:42 +01:00
fn-param-wrap-parens.fixed
fn-param-wrap-parens.rs
fn-param-wrap-parens.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
for-loop.rs
if-let-while-let.rs
inconsistent-modes.rs
inconsistent-modes.stderr
inner-or-pat.or3.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
inner-or-pat.or4.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
inner-or-pat.rs
issue-64879-trailing-before-guard.rs
issue-64879-trailing-before-guard.stderr
issue-67514-irrefutable-param.rs
issue-68785-irrefutable-param-with-at.rs
issue-69875-should-have-been-expanded-earlier-non-exhaustive.rs
issue-69875-should-have-been-expanded-earlier-non-exhaustive.stderr Perform match checking on THIR. 2023-04-03 15:59:21 +00:00
issue-69875-should-have-been-expanded-earlier.rs
issue-70413-no-unreachable-pat-and-guard.rs
let-pattern.rs
macro-pat.rs
mismatched-bindings-async-fn.rs
mismatched-bindings-async-fn.stderr
missing-bindings.rs
missing-bindings.stderr Replace HashMap with IndexMap in pattern binding resolve 2023-10-02 19:12:42 +02:00
mix-with-wild.rs
multiple-pattern-typo.rs
multiple-pattern-typo.stderr
nested-undelimited-precedence.rs
nested-undelimited-precedence.stderr Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
or-patterns-binding-type-mismatch.rs
or-patterns-binding-type-mismatch.stderr
or-patterns-default-binding-modes.rs Rename drop_ref lint to dropping_references 2023-05-21 14:16:41 +02:00
or-patterns-syntactic-fail-2018.rs
or-patterns-syntactic-fail-2018.stderr
or-patterns-syntactic-fail.rs Rip it out 2023-05-01 16:15:13 +08:00
or-patterns-syntactic-fail.stderr Detect ruby-style closure in parser 2023-10-12 21:50:18 +00:00
or-patterns-syntactic-pass-2021.rs
or-patterns-syntactic-pass.rs
or-patterns-syntactic-pass.stderr
remove-leading-vert.fixed
remove-leading-vert.rs
remove-leading-vert.stderr
search-via-bindings.rs
slice-patterns.rs
struct-like.rs
while-parsing-this-or-pattern.rs
while-parsing-this-or-pattern.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00