Clarify undecided semantics

This commit is contained in:
varkor 2018-11-20 21:33:57 +00:00
parent d2b340758b
commit 32a8dec889
3 changed files with 10 additions and 4 deletions

View file

@ -1,3 +1,6 @@
// The precise semantics of inhabitedness with respect to unions and references is currently
// undecided. This test file currently checks a conservative choice.
#![feature(exhaustive_patterns)]
#![feature(never_type)]

View file

@ -1,23 +1,23 @@
error[E0004]: non-exhaustive patterns: type &'static ! is non-empty
--> $DIR/always-inhabited-union-ref.rs:20:11
--> $DIR/always-inhabited-union-ref.rs:23:11
|
LL | match uninhab_ref() {
| ^^^^^^^^^^^^^
|
help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
--> $DIR/always-inhabited-union-ref.rs:20:11
--> $DIR/always-inhabited-union-ref.rs:23:11
|
LL | match uninhab_ref() {
| ^^^^^^^^^^^^^
error[E0004]: non-exhaustive patterns: type Foo is non-empty
--> $DIR/always-inhabited-union-ref.rs:24:11
--> $DIR/always-inhabited-union-ref.rs:27:11
|
LL | match uninhab_union() {
| ^^^^^^^^^^^^^^^
|
help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
--> $DIR/always-inhabited-union-ref.rs:24:11
--> $DIR/always-inhabited-union-ref.rs:27:11
|
LL | match uninhab_union() {
| ^^^^^^^^^^^^^^^