diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:39 +0000 |
commit | 1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch) | |
tree | 3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /tests/ui/match | |
parent | Releasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip |
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/match')
-rw-r--r-- | tests/ui/match/guards-parenthesized-and.rs | 10 | ||||
-rw-r--r-- | tests/ui/match/match-range-fail-2.rs | 9 | ||||
-rw-r--r-- | tests/ui/match/match-range-fail-2.stderr | 24 |
3 files changed, 16 insertions, 27 deletions
diff --git a/tests/ui/match/guards-parenthesized-and.rs b/tests/ui/match/guards-parenthesized-and.rs new file mode 100644 index 000000000..3a1c341f3 --- /dev/null +++ b/tests/ui/match/guards-parenthesized-and.rs @@ -0,0 +1,10 @@ +// check-pass + +fn main() { + let c = 1; + let w = "T"; + match Some(5) { + None if c == 1 && (w != "Y" && w != "E") => {} + _ => panic!(), + } +} diff --git a/tests/ui/match/match-range-fail-2.rs b/tests/ui/match/match-range-fail-2.rs index 792664e1d..4489cf1ab 100644 --- a/tests/ui/match/match-range-fail-2.rs +++ b/tests/ui/match/match-range-fail-2.rs @@ -3,22 +3,19 @@ fn main() { match 5 { 6 ..= 1 => { } + //~^ ERROR lower range bound must be less than or equal to upper _ => { } }; - //~^^^ ERROR lower range bound must be less than or equal to upper - //~| ERROR lower range bound must be less than or equal to upper match 5 { 0 .. 0 => { } + //~^ ERROR lower range bound must be less than upper _ => { } }; - //~^^^ ERROR lower range bound must be less than upper - //~| ERROR lower range bound must be less than upper match 5u64 { 0xFFFF_FFFF_FFFF_FFFF ..= 1 => { } + //~^ ERROR lower range bound must be less than or equal to upper _ => { } }; - //~^^^ ERROR lower range bound must be less than or equal to upper - //~| ERROR lower range bound must be less than or equal to upper } diff --git a/tests/ui/match/match-range-fail-2.stderr b/tests/ui/match/match-range-fail-2.stderr index 7a0852d7e..52a2bf2b3 100644 --- a/tests/ui/match/match-range-fail-2.stderr +++ b/tests/ui/match/match-range-fail-2.stderr @@ -5,36 +5,18 @@ LL | 6 ..= 1 => { } | ^ lower bound larger than upper bound error[E0579]: lower range bound must be less than upper - --> $DIR/match-range-fail-2.rs:12:9 + --> $DIR/match-range-fail-2.rs:11:9 | LL | 0 .. 0 => { } | ^ error[E0030]: lower range bound must be less than or equal to upper - --> $DIR/match-range-fail-2.rs:19:9 + --> $DIR/match-range-fail-2.rs:17:9 | LL | 0xFFFF_FFFF_FFFF_FFFF ..= 1 => { } | ^^^^^^^^^^^^^^^^^^^^^ lower bound larger than upper bound -error[E0030]: lower range bound must be less than or equal to upper - --> $DIR/match-range-fail-2.rs:5:9 - | -LL | 6 ..= 1 => { } - | ^ lower bound larger than upper bound - -error[E0579]: lower range bound must be less than upper - --> $DIR/match-range-fail-2.rs:12:9 - | -LL | 0 .. 0 => { } - | ^ - -error[E0030]: lower range bound must be less than or equal to upper - --> $DIR/match-range-fail-2.rs:19:9 - | -LL | 0xFFFF_FFFF_FFFF_FFFF ..= 1 => { } - | ^^^^^^^^^^^^^^^^^^^^^ lower bound larger than upper bound - -error: aborting due to 6 previous errors +error: aborting due to 3 previous errors Some errors have detailed explanations: E0030, E0579. For more information about an error, try `rustc --explain E0030`. |