summaryrefslogtreecommitdiffstats
path: root/src/test/ui/structs/struct-tuple-field-names.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/structs/struct-tuple-field-names.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/structs/struct-tuple-field-names.rs b/src/test/ui/structs/struct-tuple-field-names.rs
new file mode 100644
index 000000000..7bd54af1d
--- /dev/null
+++ b/src/test/ui/structs/struct-tuple-field-names.rs
@@ -0,0 +1,15 @@
+struct S(i32, f32);
+enum E {
+ S(i32, f32),
+}
+fn main() {
+ let x = E::S(1, 2.2);
+ match x {
+ E::S { 0, 1 } => {}
+ //~^ ERROR tuple variant `E::S` written as struct variant [E0769]
+ }
+ let y = S(1, 2.2);
+ match y {
+ S { } => {} //~ ERROR: tuple variant `S` written as struct variant [E0769]
+ }
+}