mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
ee80c8d0a8
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
20 lines
916 B
Plaintext
20 lines
916 B
Plaintext
error[E0004]: non-exhaustive patterns: `box ElementKind::HTMLImageElement(_)` not covered
|
|
--> $DIR/issue-3601.rs:30:44
|
|
|
|
|
LL | box NodeKind::Element(ed) => match ed.kind {
|
|
| ^^^^^^^ pattern `box ElementKind::HTMLImageElement(_)` not covered
|
|
|
|
|
note: `Box<ElementKind>` defined here
|
|
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
|
= note: the matched value is of type `Box<ElementKind>`
|
|
= note: match arms with guards don't count towards exhaustivity
|
|
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
|
|
|
|
LL ~ box ElementKind::HTMLImageElement(ref d) if d.image.is_some() => true,
|
|
LL ~ box ElementKind::HTMLImageElement(_) => todo!(),
|
|
|
|
|
|
|
error: aborting due to 1 previous error
|
|
|
|
For more information about this error, try `rustc --explain E0004`.
|