Skip to content

Commit

Permalink
Forgot to update some test outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril committed Dec 4, 2019
1 parent 40f434b commit 3e6dc2b
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 64 deletions.
2 changes: 1 addition & 1 deletion src/test/ui/rfc-2008-non-exhaustive/enum.rs
Expand Up @@ -21,7 +21,7 @@ fn main() {
};

match enum_unit {};
//~^ ERROR non-exhaustive patterns: multiple patterns of type `enums::NonExhaustiveEnum` are not handled [E0004]
//~^ ERROR non-exhaustive patterns: `_` not covered [E0004]

// Everything below this is expected to compile successfully.

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/rfc-2008-non-exhaustive/enum.stderr
Expand Up @@ -14,11 +14,11 @@ LL | match enum_unit {
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

error[E0004]: non-exhaustive patterns: multiple patterns of type `enums::NonExhaustiveEnum` are not handled
error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/enum.rs:23:11
|
LL | match enum_unit {};
| ^^^^^^^^^
| ^^^^^^^^^ pattern `_` not covered
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

Expand Down
Expand Up @@ -3,20 +3,20 @@
#[non_exhaustive]
pub enum NonExhaustiveEnum {
Unit,
//~^ variant not covered
//~^ not covered
Tuple(u32),
//~^ variant not covered
//~^ not covered
Struct { field: u32 }
//~^ variant not covered
//~^ not covered
}

pub enum NormalEnum {
Unit,
//~^ variant not covered
//~^ not covered
Tuple(u32),
//~^ variant not covered
//~^ not covered
Struct { field: u32 }
//~^ variant not covered
//~^ not covered
}

#[non_exhaustive]
Expand All @@ -25,13 +25,13 @@ pub enum EmptyNonExhaustiveEnum {}
fn empty_non_exhaustive(x: EmptyNonExhaustiveEnum) {
match x {}
match x {
_ => {} // FIXME: should be unreachable
_ => {} // not detected as unreachable
}
}

fn main() {
match NonExhaustiveEnum::Unit {}
//~^ ERROR multiple patterns of type `NonExhaustiveEnum` are not handled [E0004]
//~^ ERROR `Unit`, `Tuple(_)` and `Struct { .. }` not covered [E0004]
match NormalEnum::Unit {}
//~^ ERROR multiple patterns of type `NormalEnum` are not handled [E0004]
//~^ ERROR `Unit`, `Tuple(_)` and `Struct { .. }` not covered [E0004]
}
@@ -1,42 +1,42 @@
error[E0004]: non-exhaustive patterns: multiple patterns of type `NonExhaustiveEnum` are not handled
error[E0004]: non-exhaustive patterns: `Unit`, `Tuple(_)` and `Struct { .. }` not covered
--> $DIR/enum_same_crate_empty_match.rs:33:11
|
LL | / pub enum NonExhaustiveEnum {
LL | | Unit,
| | ---- variant not covered
| | ---- not covered
LL | |
LL | | Tuple(u32),
| | ----- variant not covered
| | ----- not covered
LL | |
LL | | Struct { field: u32 }
| | ------ variant not covered
| | ------ not covered
LL | |
LL | | }
| |_- `NonExhaustiveEnum` defined here
...
LL | match NonExhaustiveEnum::Unit {}
| ^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^ patterns `Unit`, `Tuple(_)` and `Struct { .. }` not covered
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

error[E0004]: non-exhaustive patterns: multiple patterns of type `NormalEnum` are not handled
error[E0004]: non-exhaustive patterns: `Unit`, `Tuple(_)` and `Struct { .. }` not covered
--> $DIR/enum_same_crate_empty_match.rs:35:11
|
LL | / pub enum NormalEnum {
LL | | Unit,
| | ---- variant not covered
| | ---- not covered
LL | |
LL | | Tuple(u32),
| | ----- variant not covered
| | ----- not covered
LL | |
LL | | Struct { field: u32 }
| | ------ variant not covered
| | ------ not covered
LL | |
LL | | }
| |_- `NormalEnum` defined here
...
LL | match NormalEnum::Unit {}
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^ patterns `Unit`, `Tuple(_)` and `Struct { .. }` not covered
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

Expand Down
@@ -1,28 +1,28 @@
error[E0004]: non-exhaustive patterns: pattern `IndirectUninhabitedEnum` of type `uninhabited::IndirectUninhabitedEnum` is not handled
error[E0004]: non-exhaustive patterns: type `uninhabited::IndirectUninhabitedEnum` is non-empty
--> $DIR/indirect_match.rs:18:11
|
LL | match x {}
| ^
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

error[E0004]: non-exhaustive patterns: pattern `IndirectUninhabitedStruct` of type `uninhabited::IndirectUninhabitedStruct` is not handled
error[E0004]: non-exhaustive patterns: type `uninhabited::IndirectUninhabitedStruct` is non-empty
--> $DIR/indirect_match.rs:22:11
|
LL | match x {}
| ^
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

error[E0004]: non-exhaustive patterns: pattern `IndirectUninhabitedTupleStruct` of type `uninhabited::IndirectUninhabitedTupleStruct` is not handled
error[E0004]: non-exhaustive patterns: type `uninhabited::IndirectUninhabitedTupleStruct` is non-empty
--> $DIR/indirect_match.rs:26:11
|
LL | match x {}
| ^
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

error[E0004]: non-exhaustive patterns: pattern `IndirectUninhabitedVariants` of type `uninhabited::IndirectUninhabitedVariants` is not handled
error[E0004]: non-exhaustive patterns: type `uninhabited::IndirectUninhabitedVariants` is non-empty
--> $DIR/indirect_match.rs:32:11
|
LL | match x {}
Expand Down
@@ -1,53 +1,41 @@
error[E0004]: non-exhaustive patterns: pattern `IndirectUninhabitedEnum` of type `IndirectUninhabitedEnum` is not handled
error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedEnum` is non-empty
--> $DIR/indirect_match_same_crate.rs:32:11
|
LL | pub struct IndirectUninhabitedEnum(UninhabitedEnum);
| ----------------------------------------------------
| | |
| | variant not covered
| `IndirectUninhabitedEnum` defined here
| ---------------------------------------------------- `IndirectUninhabitedEnum` defined here
...
LL | match x {}
| ^
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

error[E0004]: non-exhaustive patterns: pattern `IndirectUninhabitedStruct` of type `IndirectUninhabitedStruct` is not handled
error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedStruct` is non-empty
--> $DIR/indirect_match_same_crate.rs:36:11
|
LL | pub struct IndirectUninhabitedStruct(UninhabitedStruct);
| --------------------------------------------------------
| | |
| | variant not covered
| `IndirectUninhabitedStruct` defined here
| -------------------------------------------------------- `IndirectUninhabitedStruct` defined here
...
LL | match x {}
| ^
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

error[E0004]: non-exhaustive patterns: pattern `IndirectUninhabitedTupleStruct` of type `IndirectUninhabitedTupleStruct` is not handled
error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedTupleStruct` is non-empty
--> $DIR/indirect_match_same_crate.rs:40:11
|
LL | pub struct IndirectUninhabitedTupleStruct(UninhabitedTupleStruct);
| ------------------------------------------------------------------
| | |
| | variant not covered
| `IndirectUninhabitedTupleStruct` defined here
| ------------------------------------------------------------------ `IndirectUninhabitedTupleStruct` defined here
...
LL | match x {}
| ^
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

error[E0004]: non-exhaustive patterns: pattern `IndirectUninhabitedVariants` of type `IndirectUninhabitedVariants` is not handled
error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedVariants` is non-empty
--> $DIR/indirect_match_same_crate.rs:46:11
|
LL | pub struct IndirectUninhabitedVariants(UninhabitedVariants);
| ------------------------------------------------------------
| | |
| | variant not covered
| `IndirectUninhabitedVariants` defined here
| ------------------------------------------------------------ `IndirectUninhabitedVariants` defined here
...
LL | match x {}
| ^
Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr
Expand Up @@ -6,27 +6,27 @@ LL | match x {}
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

error[E0004]: non-exhaustive patterns: pattern `UninhabitedStruct` of type `uninhabited::UninhabitedStruct` is not handled
error[E0004]: non-exhaustive patterns: type `uninhabited::UninhabitedStruct` is non-empty
--> $DIR/match.rs:22:11
|
LL | match x {}
| ^
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

error[E0004]: non-exhaustive patterns: pattern `UninhabitedTupleStruct` of type `uninhabited::UninhabitedTupleStruct` is not handled
error[E0004]: non-exhaustive patterns: type `uninhabited::UninhabitedTupleStruct` is non-empty
--> $DIR/match.rs:26:11
|
LL | match x {}
| ^
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

error[E0004]: non-exhaustive patterns: multiple patterns of type `uninhabited::UninhabitedVariants` are not handled
error[E0004]: non-exhaustive patterns: `Tuple(_)` and `Struct { .. }` not covered
--> $DIR/match.rs:30:11
|
LL | match x {}
| ^
| ^ patterns `Tuple(_)` and `Struct { .. }` not covered
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

Expand Down
@@ -1,10 +1,7 @@
error[E0004]: non-exhaustive patterns: pattern `UninhabitedStruct` of type `UninhabitedStruct` is not handled
error[E0004]: non-exhaustive patterns: type `UninhabitedStruct` is non-empty
--> $DIR/match_same_crate.rs:28:11
|
LL | pub struct UninhabitedStruct {
| - ----------------- variant not covered
| _|
| |
LL | / pub struct UninhabitedStruct {
LL | | _priv: !,
LL | | }
| |_- `UninhabitedStruct` defined here
Expand All @@ -14,33 +11,30 @@ LL | match x {}
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

error[E0004]: non-exhaustive patterns: pattern `UninhabitedTupleStruct` of type `UninhabitedTupleStruct` is not handled
error[E0004]: non-exhaustive patterns: type `UninhabitedTupleStruct` is non-empty
--> $DIR/match_same_crate.rs:32:11
|
LL | pub struct UninhabitedTupleStruct(!);
| -------------------------------------
| | |
| | variant not covered
| `UninhabitedTupleStruct` defined here
| ------------------------------------- `UninhabitedTupleStruct` defined here
...
LL | match x {}
| ^
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

error[E0004]: non-exhaustive patterns: multiple patterns of type `UninhabitedVariants` are not handled
error[E0004]: non-exhaustive patterns: `Tuple(_)` and `Struct { .. }` not covered
--> $DIR/match_same_crate.rs:36:11
|
LL | / pub enum UninhabitedVariants {
LL | | #[non_exhaustive] Tuple(!),
| | ----- variant not covered
| | ----- not covered
LL | | #[non_exhaustive] Struct { x: ! }
| | ------ variant not covered
| | ------ not covered
LL | | }
| |_- `UninhabitedVariants` defined here
...
LL | match x {}
| ^
| ^ patterns `Tuple(_)` and `Struct { .. }` not covered
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

Expand Down

0 comments on commit 3e6dc2b

Please sign in to comment.