about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorDaniel Noom <ggatw@outlook.com>2021-01-03 14:13:33 +0100
committerDaniel Noom <ggatw@outlook.com>2021-01-03 19:05:23 +0100
commit998bf0ab88a372c1b19dd367c1fe6f51728b87eb (patch)
tree6114960da123901bbbb3b31606b06692f2df8bd4 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent18cb4ad3b9440b3ff2ed16976f56889b23811e13 (diff)
downloadrust-998bf0ab88a372c1b19dd367c1fe6f51728b87eb.tar.gz
rust-998bf0ab88a372c1b19dd367c1fe6f51728b87eb.zip
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
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions