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 --- .../struct-enum-ignoring-field-with-underscore.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/test/ui/structs-enums/struct-enum-ignoring-field-with-underscore.rs (limited to 'src/test/ui/structs-enums/struct-enum-ignoring-field-with-underscore.rs') diff --git a/src/test/ui/structs-enums/struct-enum-ignoring-field-with-underscore.rs b/src/test/ui/structs-enums/struct-enum-ignoring-field-with-underscore.rs new file mode 100644 index 000000000..c30b8a1e1 --- /dev/null +++ b/src/test/ui/structs-enums/struct-enum-ignoring-field-with-underscore.rs @@ -0,0 +1,12 @@ +enum Foo { + Bar { bar: bool }, + Other, +} + +fn main() { + let foo = Some(Foo::Other); + + if let Some(Foo::Bar {_}) = foo {} + //~^ ERROR expected identifier, found reserved identifier `_` + //~| ERROR pattern does not mention field `bar` [E0027] +} -- cgit v1.2.3