diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:11:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:11:28 +0000 |
commit | 94a0819fe3a0d679c3042a77bfe6a2afc505daea (patch) | |
tree | 2b827afe6a05f3538db3f7803a88c4587fe85648 /src/test/ui/match | |
parent | Adding upstream version 1.64.0+dfsg1. (diff) | |
download | rustc-94a0819fe3a0d679c3042a77bfe6a2afc505daea.tar.xz rustc-94a0819fe3a0d679c3042a77bfe6a2afc505daea.zip |
Adding upstream version 1.66.0+dfsg1.upstream/1.66.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/expr_before_ident_pat.rs | 2 | ||||
-rw-r--r-- | src/test/ui/match/expr_before_ident_pat.stderr | 4 | ||||
-rw-r--r-- | src/test/ui/match/issue-41255.rs | 1 | ||||
-rw-r--r-- | src/test/ui/match/issue-41255.stderr | 30 | ||||
-rw-r--r-- | src/test/ui/match/issue-42679.rs | 7 | ||||
-rw-r--r-- | src/test/ui/match/issue-92100.rs | 2 | ||||
-rw-r--r-- | src/test/ui/match/match_non_exhaustive.rs | 2 | ||||
-rw-r--r-- | src/test/ui/match/match_non_exhaustive.stderr | 8 |
8 files changed, 26 insertions, 30 deletions
diff --git a/src/test/ui/match/expr_before_ident_pat.rs b/src/test/ui/match/expr_before_ident_pat.rs index 47db6c3f4..27ef3d05a 100644 --- a/src/test/ui/match/expr_before_ident_pat.rs +++ b/src/test/ui/match/expr_before_ident_pat.rs @@ -1,5 +1,3 @@ -#![feature(half_open_range_patterns)] - macro_rules! funny { ($a:expr, $b:ident) => { match [1, 2] { diff --git a/src/test/ui/match/expr_before_ident_pat.stderr b/src/test/ui/match/expr_before_ident_pat.stderr index 2bd1b3b94..57a2d2b26 100644 --- a/src/test/ui/match/expr_before_ident_pat.stderr +++ b/src/test/ui/match/expr_before_ident_pat.stderr @@ -1,11 +1,11 @@ error[E0425]: cannot find value `a` in this scope - --> $DIR/expr_before_ident_pat.rs:12:12 + --> $DIR/expr_before_ident_pat.rs:10:12 | LL | funny!(a, a); | ^ not found in this scope error: arbitrary expressions aren't allowed in patterns - --> $DIR/expr_before_ident_pat.rs:12:12 + --> $DIR/expr_before_ident_pat.rs:10:12 | LL | funny!(a, a); | ^ diff --git a/src/test/ui/match/issue-41255.rs b/src/test/ui/match/issue-41255.rs index 9d7072f16..d163801fd 100644 --- a/src/test/ui/match/issue-41255.rs +++ b/src/test/ui/match/issue-41255.rs @@ -1,7 +1,6 @@ // Matching against float literals should result in a linter error #![feature(exclusive_range_pattern)] -#![feature(half_open_range_patterns)] #![allow(unused)] #![forbid(illegal_floating_point_literal_pattern)] diff --git a/src/test/ui/match/issue-41255.stderr b/src/test/ui/match/issue-41255.stderr index bf81c8d37..9bc49654e 100644 --- a/src/test/ui/match/issue-41255.stderr +++ b/src/test/ui/match/issue-41255.stderr @@ -1,19 +1,19 @@ error: floating-point types cannot be used in patterns - --> $DIR/issue-41255.rs:11:9 + --> $DIR/issue-41255.rs:10:9 | LL | 5.0 => {}, | ^^^ | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620> note: the lint level is defined here - --> $DIR/issue-41255.rs:6:11 + --> $DIR/issue-41255.rs:5:11 | LL | #![forbid(illegal_floating_point_literal_pattern)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620> error: floating-point types cannot be used in patterns - --> $DIR/issue-41255.rs:13:9 + --> $DIR/issue-41255.rs:12:9 | LL | 5.0f32 => {}, | ^^^^^^ @@ -22,7 +22,7 @@ LL | 5.0f32 => {}, = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620> error: floating-point types cannot be used in patterns - --> $DIR/issue-41255.rs:15:10 + --> $DIR/issue-41255.rs:14:10 | LL | -5.0 => {}, | ^^^ @@ -31,7 +31,7 @@ LL | -5.0 => {}, = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620> error: floating-point types cannot be used in patterns - --> $DIR/issue-41255.rs:17:9 + --> $DIR/issue-41255.rs:16:9 | LL | 1.0 .. 33.0 => {}, | ^^^ @@ -40,7 +40,7 @@ LL | 1.0 .. 33.0 => {}, = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620> error: floating-point types cannot be used in patterns - --> $DIR/issue-41255.rs:17:16 + --> $DIR/issue-41255.rs:16:16 | LL | 1.0 .. 33.0 => {}, | ^^^^ @@ -49,7 +49,7 @@ LL | 1.0 .. 33.0 => {}, = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620> error: floating-point types cannot be used in patterns - --> $DIR/issue-41255.rs:21:9 + --> $DIR/issue-41255.rs:20:9 | LL | 39.0 ..= 70.0 => {}, | ^^^^ @@ -58,7 +58,7 @@ LL | 39.0 ..= 70.0 => {}, = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620> error: floating-point types cannot be used in patterns - --> $DIR/issue-41255.rs:21:18 + --> $DIR/issue-41255.rs:20:18 | LL | 39.0 ..= 70.0 => {}, | ^^^^ @@ -67,7 +67,7 @@ LL | 39.0 ..= 70.0 => {}, = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620> error: floating-point types cannot be used in patterns - --> $DIR/issue-41255.rs:26:11 + --> $DIR/issue-41255.rs:25:11 | LL | ..71.0 => {} | ^^^^ @@ -76,7 +76,7 @@ LL | ..71.0 => {} = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620> error: floating-point types cannot be used in patterns - --> $DIR/issue-41255.rs:29:12 + --> $DIR/issue-41255.rs:28:12 | LL | ..=72.0 => {} | ^^^^ @@ -85,7 +85,7 @@ LL | ..=72.0 => {} = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620> error: floating-point types cannot be used in patterns - --> $DIR/issue-41255.rs:32:9 + --> $DIR/issue-41255.rs:31:9 | LL | 71.0.. => {} | ^^^^ @@ -94,7 +94,7 @@ LL | 71.0.. => {} = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620> error: floating-point types cannot be used in patterns - --> $DIR/issue-41255.rs:40:10 + --> $DIR/issue-41255.rs:39:10 | LL | (3.14, 1) => {}, | ^^^^ @@ -103,7 +103,7 @@ LL | (3.14, 1) => {}, = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620> error: floating-point types cannot be used in patterns - --> $DIR/issue-41255.rs:47:18 + --> $DIR/issue-41255.rs:46:18 | LL | Foo { x: 2.0 } => {}, | ^^^ 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/issue-92100.rs b/src/test/ui/match/issue-92100.rs index 021166b2b..baac570dd 100644 --- a/src/test/ui/match/issue-92100.rs +++ b/src/test/ui/match/issue-92100.rs @@ -1,4 +1,4 @@ -#![feature(half_open_range_patterns)] +#![feature(half_open_range_patterns_in_slices)] fn main() { match [1, 2] { 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 |