summaryrefslogtreecommitdiffstats
path: root/tests/ui/pattern/usefulness/non-exhaustive-defined-here.stderr
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/ui/pattern/usefulness/non-exhaustive-defined-here.stderr (renamed from src/test/ui/pattern/usefulness/non-exhaustive-defined-here.stderr)58
1 files changed, 27 insertions, 31 deletions
diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-defined-here.stderr b/tests/ui/pattern/usefulness/non-exhaustive-defined-here.stderr
index 678c9b2ab..769d4070f 100644
--- a/src/test/ui/pattern/usefulness/non-exhaustive-defined-here.stderr
+++ b/tests/ui/pattern/usefulness/non-exhaustive-defined-here.stderr
@@ -1,5 +1,5 @@
error[E0004]: non-exhaustive patterns: `E::B` and `E::C` not covered
- --> $DIR/non-exhaustive-defined-here.rs:38:11
+ --> $DIR/non-exhaustive-defined-here.rs:35:11
|
LL | match e1 {
| ^^ patterns `E::B` and `E::C` not covered
@@ -22,8 +22,8 @@ LL ~ E::A => {}
LL + E::B | E::C => todo!()
|
-error[E0005]: refutable pattern in local binding: `E::B` and `E::C` not covered
- --> $DIR/non-exhaustive-defined-here.rs:44:9
+error[E0005]: refutable pattern in local binding
+ --> $DIR/non-exhaustive-defined-here.rs:41:9
|
LL | let E::A = e;
| ^^^^ patterns `E::B` and `E::C` not covered
@@ -31,16 +31,16 @@ LL | let E::A = e;
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `E` defined here
- --> $DIR/non-exhaustive-defined-here.rs:14:5
+ --> $DIR/non-exhaustive-defined-here.rs:6:6
|
LL | enum E {
- | -
+ | ^
...
LL | B,
- | ^ not covered
+ | - not covered
...
LL | C
- | ^ not covered
+ | - not covered
= note: the matched value is of type `E`
help: you might want to use `if let` to ignore the variants that aren't matched
|
@@ -48,7 +48,7 @@ LL | if let E::A = e { todo!() }
| ++ ~~~~~~~~~~~
error[E0004]: non-exhaustive patterns: `&E::B` and `&E::C` not covered
- --> $DIR/non-exhaustive-defined-here.rs:52:11
+ --> $DIR/non-exhaustive-defined-here.rs:50:11
|
LL | match e {
| ^ patterns `&E::B` and `&E::C` not covered
@@ -71,8 +71,8 @@ LL ~ E::A => {}
LL + &E::B | &E::C => todo!()
|
-error[E0005]: refutable pattern in local binding: `&E::B` and `&E::C` not covered
- --> $DIR/non-exhaustive-defined-here.rs:58:9
+error[E0005]: refutable pattern in local binding
+ --> $DIR/non-exhaustive-defined-here.rs:57:9
|
LL | let E::A = e;
| ^^^^ patterns `&E::B` and `&E::C` not covered
@@ -80,16 +80,16 @@ LL | let E::A = e;
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `E` defined here
- --> $DIR/non-exhaustive-defined-here.rs:14:5
+ --> $DIR/non-exhaustive-defined-here.rs:6:6
|
LL | enum E {
- | -
+ | ^
...
LL | B,
- | ^ not covered
+ | - not covered
...
LL | C
- | ^ not covered
+ | - not covered
= note: the matched value is of type `&E`
help: you might want to use `if let` to ignore the variants that aren't matched
|
@@ -120,8 +120,8 @@ LL ~ E::A => {}
LL + &&mut &E::B | &&mut &E::C => todo!()
|
-error[E0005]: refutable pattern in local binding: `&&mut &E::B` and `&&mut &E::C` not covered
- --> $DIR/non-exhaustive-defined-here.rs:72:9
+error[E0005]: refutable pattern in local binding
+ --> $DIR/non-exhaustive-defined-here.rs:73:9
|
LL | let E::A = e;
| ^^^^ patterns `&&mut &E::B` and `&&mut &E::C` not covered
@@ -129,16 +129,16 @@ LL | let E::A = e;
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `E` defined here
- --> $DIR/non-exhaustive-defined-here.rs:14:5
+ --> $DIR/non-exhaustive-defined-here.rs:6:6
|
LL | enum E {
- | -
+ | ^
...
LL | B,
- | ^ not covered
+ | - not covered
...
LL | C
- | ^ not covered
+ | - not covered
= note: the matched value is of type `&&mut &E`
help: you might want to use `if let` to ignore the variants that aren't matched
|
@@ -152,7 +152,7 @@ LL | match e {
| ^ pattern `Opt::None` not covered
|
note: `Opt` defined here
- --> $DIR/non-exhaustive-defined-here.rs:84:5
+ --> $DIR/non-exhaustive-defined-here.rs:85:5
|
LL | enum Opt {
| ---
@@ -166,8 +166,8 @@ LL ~ Opt::Some(ref _x) => {}
LL + Opt::None => todo!()
|
-error[E0005]: refutable pattern in local binding: `Opt::None` not covered
- --> $DIR/non-exhaustive-defined-here.rs:98:9
+error[E0005]: refutable pattern in local binding
+ --> $DIR/non-exhaustive-defined-here.rs:99:9
|
LL | let Opt::Some(ref _x) = e;
| ^^^^^^^^^^^^^^^^^ pattern `Opt::None` not covered
@@ -175,19 +175,15 @@ LL | let Opt::Some(ref _x) = e;
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Opt` defined here
- --> $DIR/non-exhaustive-defined-here.rs:84:5
+ --> $DIR/non-exhaustive-defined-here.rs:81:6
|
LL | enum Opt {
- | ---
+ | ^^^
...
LL | None,
- | ^^^^ not covered
+ | ---- not covered
= note: the matched value is of type `Opt`
-help: you might want to use `if let` to ignore the variant that isn't matched
- |
-LL | let _x = if let Opt::Some(ref _x) = e { _x } else { todo!() };
- | +++++++++++ +++++++++++++++++++++++
-help: alternatively, you might want to use let else to handle the variant that isn't matched
+help: you might want to use `let else` to handle the variant that isn't matched
|
LL | let Opt::Some(ref _x) = e else { todo!() };
| ++++++++++++++++