diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:03:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:03:36 +0000 |
commit | 17d40c6057c88f4c432b0d7bac88e1b84cb7e67f (patch) | |
tree | 3f66c4a5918660bb8a758ab6cda5ff8ee4f6cdcd /src/test/ui/match | |
parent | Adding upstream version 1.64.0+dfsg1. (diff) | |
download | rustc-upstream/1.65.0+dfsg1.tar.xz rustc-upstream/1.65.0+dfsg1.zip |
Adding upstream version 1.65.0+dfsg1.upstream/1.65.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/match')
-rw-r--r-- | src/test/ui/match/issue-42679.rs | 7 | ||||
-rw-r--r-- | src/test/ui/match/match_non_exhaustive.rs | 2 | ||||
-rw-r--r-- | src/test/ui/match/match_non_exhaustive.stderr | 8 |
3 files changed, 8 insertions, 9 deletions
diff --git a/src/test/ui/match/issue-42679.rs b/src/test/ui/match/issue-42679.rs index 596309f25..46a0bd35d 100644 --- a/src/test/ui/match/issue-42679.rs +++ b/src/test/ui/match/issue-42679.rs @@ -1,5 +1,4 @@ // run-pass -#![feature(box_syntax)] #![feature(box_patterns)] #[derive(Debug, PartialEq)] @@ -9,13 +8,13 @@ enum Test { } fn main() { - let a = box Test::Foo(10); - let b = box Test::Bar(-20); + let a = Box::new(Test::Foo(10)); + let b = Box::new(Test::Bar(-20)); match (a, b) { (_, box Test::Foo(_)) => unreachable!(), (box Test::Foo(x), b) => { assert_eq!(x, 10); - assert_eq!(b, box Test::Bar(-20)); + assert_eq!(b, Box::new(Test::Bar(-20))); }, _ => unreachable!(), } diff --git a/src/test/ui/match/match_non_exhaustive.rs b/src/test/ui/match/match_non_exhaustive.rs index 8219f0eb1..f162dd60f 100644 --- a/src/test/ui/match/match_non_exhaustive.rs +++ b/src/test/ui/match/match_non_exhaustive.rs @@ -21,7 +21,7 @@ fn main() { match l { L::A => (), L::B => () }; // (except if the match is already non-exhaustive) match l { L::A => () }; - //~^ ERROR: non-exhaustive patterns: `B` not covered [E0004] + //~^ ERROR: non-exhaustive patterns: `L::B` not covered [E0004] // E1 is not visibly uninhabited from here let (e1, e2) = bar(); diff --git a/src/test/ui/match/match_non_exhaustive.stderr b/src/test/ui/match/match_non_exhaustive.stderr index 9d92f8fdb..46ee8d517 100644 --- a/src/test/ui/match/match_non_exhaustive.stderr +++ b/src/test/ui/match/match_non_exhaustive.stderr @@ -1,8 +1,8 @@ -error[E0004]: non-exhaustive patterns: `B` not covered +error[E0004]: non-exhaustive patterns: `L::B` not covered --> $DIR/match_non_exhaustive.rs:23:11 | LL | match l { L::A => () }; - | ^ pattern `B` not covered + | ^ pattern `L::B` not covered | note: `L` defined here --> $DIR/match_non_exhaustive.rs:10:13 @@ -12,8 +12,8 @@ LL | enum L { A, B } = note: the matched value is of type `L` 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 l { L::A => (), B => todo!() }; - | ++++++++++++++ +LL | match l { L::A => (), L::B => todo!() }; + | +++++++++++++++++ error[E0004]: non-exhaustive patterns: type `E1` is non-empty --> $DIR/match_non_exhaustive.rs:28:11 |