rust/compiler/rustc_mir_build/src
Daniel Noom 998bf0ab88 Add note to non-exhaustive match on reference to empty
Rust prints "type `&A` is non-empty" even is A is empty.
This is the intended behavior, but can be confusing.
This commit adds a note to non-exhaustive pattern errors if they are a
reference to something uninhabited.

I did not add tests to check that the note is not shown for
non-references or inhabited references, because this is already done
in other tests.

Maybe the added test is superfluous, because
`always-inhabited-union-ref` already checks for this case.

This does not handle &&Void or &&&void etc. I could add those as special
cases as well and ignore people who need quadruple
references.

Fixes #78123
2021-01-03 19:05:23 +01:00
..
build Rollup merge of #80495 - jyn514:rename-empty, r=petrochenkov 2020-12-30 20:56:58 +00:00
thir Add note to non-exhaustive match on reference to empty 2021-01-03 19:05:23 +01:00
lib.rs Cache head constructor in PatStack 2020-10-27 00:46:32 +00:00
lints.rs Don't re-export std::ops::ControlFlow in the compiler. 2020-10-22 17:26:55 -07:00