diff options
| author | Nadrieril <nadrieril+git@gmail.com> | 2024-02-28 22:26:20 +0100 |
|---|---|---|
| committer | Nadrieril <nadrieril+git@gmail.com> | 2024-03-12 21:38:31 +0100 |
| commit | b878ab6a270928fa45850183b82b13eac1e80c39 (patch) | |
| tree | 81a2fba3be80525225d820e228b1621360310256 /tests | |
| parent | 9f2aa5b85a2584568f1ad34f23d029eeafb20d4b (diff) | |
| download | rust-b878ab6a270928fa45850183b82b13eac1e80c39.tar.gz rust-b878ab6a270928fa45850183b82b13eac1e80c39.zip | |
Don't suggest an arm when suggesting a never pattern
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/pattern/usefulness/empty-types.never_pats.stderr | 30 | ||||
| -rw-r--r-- | tests/ui/rfcs/rfc-0000-never_patterns/check.stderr | 4 |
2 files changed, 17 insertions, 17 deletions
diff --git a/tests/ui/pattern/usefulness/empty-types.never_pats.stderr b/tests/ui/pattern/usefulness/empty-types.never_pats.stderr index 70d5b266bda..0ff2472922e 100644 --- a/tests/ui/pattern/usefulness/empty-types.never_pats.stderr +++ b/tests/ui/pattern/usefulness/empty-types.never_pats.stderr @@ -111,7 +111,7 @@ note: `Result<u32, !>` defined here help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | LL ~ Ok(_) => {}, -LL + Err(!) => todo!() +LL + Err(!) | error[E0004]: non-exhaustive patterns: `Ok(1_u32..=u32::MAX)` not covered @@ -192,7 +192,7 @@ note: `Result<!, !>` defined here help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms | LL ~ match result_never { -LL + Ok(!) | Err(!) => todo!(), +LL + Ok(!) | Err(!), LL + } | @@ -210,8 +210,8 @@ note: `Result<!, !>` defined here = note: the matched value is of type `Result<!, !>` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | -LL | Ok(_) => {}, Err(!) => todo!() - | +++++++++++++++++++ +LL | Ok(_) => {}, Err(!) + | ++++++++ error: unreachable pattern --> $DIR/empty-types.rs:140:13 @@ -240,7 +240,7 @@ note: `Option<Void>` defined here help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | LL ~ None => {}, -LL + Some(!) => todo!() +LL + Some(!) | error[E0004]: non-exhaustive patterns: `Some(!)` not covered @@ -258,7 +258,7 @@ note: `Option<Void>` defined here help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | LL ~ None => {}, -LL + Some(!) => todo!() +LL + Some(!) | error: unreachable pattern @@ -343,7 +343,7 @@ note: `Result<!, !>` defined here help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms | LL ~ match *x { -LL + Ok(!) | Err(!) => todo!(), +LL + Ok(!) | Err(!), LL ~ } | @@ -385,7 +385,7 @@ LL | match slice_never { help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | LL ~ [] => {}, -LL + &[!, ..] => todo!() +LL + &[!, ..] | error[E0004]: non-exhaustive patterns: `&[]`, `&[!]` and `&[!, !]` not covered @@ -492,7 +492,7 @@ note: `Option<!>` defined here help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | LL ~ &None => {}, -LL + &Some(!) => todo!() +LL + &Some(!) | error[E0004]: non-exhaustive patterns: `Some(!)` not covered @@ -510,7 +510,7 @@ note: `Option<!>` defined here help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | LL ~ None => {}, -LL + Some(!) => todo!() +LL + Some(!) | error[E0004]: non-exhaustive patterns: `Err(!)` not covered @@ -528,7 +528,7 @@ note: `Result<!, !>` defined here help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | LL ~ Ok(_) => {}, -LL + Err(!) => todo!() +LL + Err(!) | error[E0004]: non-exhaustive patterns: `Err(!)` not covered @@ -546,7 +546,7 @@ note: `Result<!, !>` defined here help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | LL ~ Ok(_a) => {}, -LL + Err(!) => todo!() +LL + Err(!) | error[E0004]: non-exhaustive patterns: type `(u32, !)` is non-empty @@ -599,7 +599,7 @@ LL | match ref_never { help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | LL ~ &_a if false => {}, -LL + &! => todo!() +LL + &! | error[E0004]: non-exhaustive patterns: `Ok(!)` not covered @@ -617,7 +617,7 @@ note: `Result<!, !>` defined here help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | LL ~ Err(_) => {}, -LL + Ok(!) => todo!() +LL + Ok(!) | error[E0004]: non-exhaustive patterns: `Some(!)` not covered @@ -635,7 +635,7 @@ note: `Option<Result<!, !>>` defined here help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | LL ~ None => {}, -LL + Some(!) => todo!() +LL + Some(!) | error: aborting due to 49 previous errors; 1 warning emitted diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/check.stderr b/tests/ui/rfcs/rfc-0000-never_patterns/check.stderr index 82457f8b805..25f7343a8a8 100644 --- a/tests/ui/rfcs/rfc-0000-never_patterns/check.stderr +++ b/tests/ui/rfcs/rfc-0000-never_patterns/check.stderr @@ -46,7 +46,7 @@ note: `Option<Void>` defined here help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | LL ~ None => {}, -LL + Some(!) => todo!() +LL + Some(!) | error[E0004]: non-exhaustive patterns: `Some(!)` not covered @@ -64,7 +64,7 @@ note: `Option<Void>` defined here help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | LL ~ None => {}, -LL + Some(!) => todo!() +LL + Some(!) | error: aborting due to 6 previous errors |
