diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/pattern/pat-tuple-overfield.rs | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/pattern/pat-tuple-overfield.rs')
-rw-r--r-- | src/test/ui/pattern/pat-tuple-overfield.rs | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/src/test/ui/pattern/pat-tuple-overfield.rs b/src/test/ui/pattern/pat-tuple-overfield.rs deleted file mode 100644 index c863c6575..000000000 --- a/src/test/ui/pattern/pat-tuple-overfield.rs +++ /dev/null @@ -1,74 +0,0 @@ -struct S(u8, u8, u8); -struct M( - u8, - u8, - u8, - u8, - u8, -); - -struct Z0; -struct Z1(); -enum E1 { - Z0, - Z1(), -} - -fn main() { - match (1, 2, 3) { - (1, 2, 3, 4) => {} //~ ERROR mismatched types - (1, 2, .., 3, 4) => {} //~ ERROR mismatched types - _ => {} - } - match S(1, 2, 3) { - S(1, 2, 3, 4) => {} - //~^ ERROR this pattern has 4 fields, but the corresponding tuple struct has 3 fields - S(1, 2, .., 3, 4) => {} - //~^ ERROR this pattern has 4 fields, but the corresponding tuple struct has 3 fields - _ => {} - } - match M(1, 2, 3, 4, 5) { - M(1, 2, 3, 4, 5, 6) => {} - //~^ ERROR this pattern has 6 fields, but the corresponding tuple struct has 5 fields - M(1, - 2, - 3, - 4, - 5, - 6) => {} - //~^ ERROR this pattern has 6 fields, but the corresponding tuple struct has 5 fields - M( - 1, - 2, - 3, - 4, - 5, - 6, - ) => {} - //~^^ ERROR this pattern has 6 fields, but the corresponding tuple struct has 5 fields - } - match Z0 { - Z0 => {} - Z0() => {} //~ ERROR expected tuple struct or tuple variant, found unit struct `Z0` - Z0(_) => {} //~ ERROR expected tuple struct or tuple variant, found unit struct `Z0` - Z0(_, _) => {} //~ ERROR expected tuple struct or tuple variant, found unit struct `Z0` - } - match Z1() { - Z1 => {} //~ ERROR match bindings cannot shadow tuple structs - Z1() => {} - Z1(_) => {} //~ ERROR this pattern has 1 field, but the corresponding tuple struct has 0 fields - Z1(_, _) => {} //~ ERROR this pattern has 2 fields, but the corresponding tuple struct has 0 fields - } - match E1::Z0 { - E1::Z0 => {} - E1::Z0() => {} //~ ERROR expected tuple struct or tuple variant, found unit variant `E1::Z0` - E1::Z0(_) => {} //~ ERROR expected tuple struct or tuple variant, found unit variant `E1::Z0` - E1::Z0(_, _) => {} //~ ERROR expected tuple struct or tuple variant, found unit variant `E1::Z0` - } - match E1::Z1() { - E1::Z1 => {} //~ ERROR expected unit struct, unit variant or constant, found tuple variant `E1::Z1` - E1::Z1() => {} - E1::Z1(_) => {} //~ ERROR this pattern has 1 field, but the corresponding tuple variant has 0 fields - E1::Z1(_, _) => {} //~ ERROR this pattern has 2 fields, but the corresponding tuple variant has 0 fields - } -} |