From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../pattern/usefulness/non-exhaustive-match.stderr | 124 +++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 src/test/ui/pattern/usefulness/non-exhaustive-match.stderr (limited to 'src/test/ui/pattern/usefulness/non-exhaustive-match.stderr') diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr new file mode 100644 index 000000000..f2362c316 --- /dev/null +++ b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr @@ -0,0 +1,124 @@ +error[E0004]: non-exhaustive patterns: `A` not covered + --> $DIR/non-exhaustive-match.rs:7:11 + | +LL | match x { T::B => { } } + | ^ pattern `A` not covered + | +note: `T` defined here + --> $DIR/non-exhaustive-match.rs:3:10 + | +LL | enum T { A, B } + | - ^ not covered + = note: the matched value is of type `T` +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 | match x { T::B => { }, A => todo!() } + | ++++++++++++++ + +error[E0004]: non-exhaustive patterns: `false` not covered + --> $DIR/non-exhaustive-match.rs:8:11 + | +LL | match true { + | ^^^^ pattern `false` not covered + | + = note: the matched value is of type `bool` +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 ~ true => {} +LL + false => todo!() + | + +error[E0004]: non-exhaustive patterns: `Some(_)` not covered + --> $DIR/non-exhaustive-match.rs:11:11 + | +LL | match Some(10) { + | ^^^^^^^^ pattern `Some(_)` not covered + | +note: `Option` defined here + --> $SRC_DIR/core/src/option.rs:LL:COL + | +LL | pub enum Option { + | ------------------ +... +LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), + | ^^^^ not covered + = note: the matched value is of type `Option` +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!() + | + +error[E0004]: non-exhaustive patterns: `(_, _, i32::MIN..=3_i32)` and `(_, _, 5_i32..=i32::MAX)` not covered + --> $DIR/non-exhaustive-match.rs:14:11 + | +LL | match (2, 3, 4) { + | ^^^^^^^^^ patterns `(_, _, i32::MIN..=3_i32)` and `(_, _, 5_i32..=i32::MAX)` not covered + | + = note: the matched value is of type `(i32, i32, i32)` +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 ~ (_, _, 4) => {} +LL + (_, _, i32::MIN..=3_i32) | (_, _, 5_i32..=i32::MAX) => todo!() + | + +error[E0004]: non-exhaustive patterns: `(A, A)` and `(B, B)` not covered + --> $DIR/non-exhaustive-match.rs:18:11 + | +LL | match (T::A, T::A) { + | ^^^^^^^^^^^^ patterns `(A, A)` and `(B, B)` not covered + | + = note: the matched value is of type `(T, T)` +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 ~ (T::B, T::A) => {} +LL + (A, A) | (B, B) => todo!() + | + +error[E0004]: non-exhaustive patterns: `B` not covered + --> $DIR/non-exhaustive-match.rs:22:11 + | +LL | match T::A { + | ^^^^ pattern `B` not covered + | +note: `T` defined here + --> $DIR/non-exhaustive-match.rs:3:13 + | +LL | enum T { A, B } + | - ^ not covered + = note: the matched value is of type `T` +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 ~ T::A => {} +LL + B => todo!() + | + +error[E0004]: non-exhaustive patterns: `[]` not covered + --> $DIR/non-exhaustive-match.rs:33:11 + | +LL | match *vec { + | ^^^^ pattern `[]` not covered + | + = note: the matched value is of type `[Option]` +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 + [] => todo!() + | + +error[E0004]: non-exhaustive patterns: `[_, _, _, _, ..]` not covered + --> $DIR/non-exhaustive-match.rs:46:11 + | +LL | match *vec { + | ^^^^ pattern `[_, _, _, _, ..]` not covered + | + = note: the matched value is of type `[f32]` +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!() + | + +error: aborting due to 8 previous errors + +For more information about this error, try `rustc --explain E0004`. -- cgit v1.2.3