mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-06 04:08:40 +00:00
![]() Without adding proper support for mixed exhaustiveness, mixing deref patterns with normal constructors would either violate `ConstructorSet::split`'s invariant 4 or 7. We'd either be ignoring rows with normal constructors or we'd have problems in unspecialization from non-disjoint constructors. Checking mixed exhaustivenss similarly to how unions are currently checked should work, but the diagnostics for unions are confusing. Since mixing deref patterns with normal constructors is pretty niche (currently it only makes sense for `Cow`), emitting an error lets us avoid committing to supporting mixed exhaustiveness without a good answer for the diagnostics. |
||
---|---|---|
.. | ||
empty-types.rs | ||
empty-types.stderr | ||
mixed-constructors.rs | ||
mixed-constructors.stderr | ||
non-exhaustive.rs | ||
non-exhaustive.stderr | ||
unreachable-patterns.rs | ||
unreachable-patterns.stderr |