summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-15260.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/issues/issue-15260.rs')
-rw-r--r--tests/ui/issues/issue-15260.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/ui/issues/issue-15260.rs b/tests/ui/issues/issue-15260.rs
new file mode 100644
index 000000000..64fc3df3d
--- /dev/null
+++ b/tests/ui/issues/issue-15260.rs
@@ -0,0 +1,25 @@
+struct Foo {
+ a: usize,
+}
+
+fn main() {
+ let Foo {
+ a: _,
+ a: _
+ //~^ ERROR field `a` bound multiple times in the pattern
+ } = Foo { a: 29 };
+
+ let Foo {
+ a,
+ a: _
+ //~^ ERROR field `a` bound multiple times in the pattern
+ } = Foo { a: 29 };
+
+ let Foo {
+ a,
+ a: _,
+ //~^ ERROR field `a` bound multiple times in the pattern
+ a: x
+ //~^ ERROR field `a` bound multiple times in the pattern
+ } = Foo { a: 29 };
+}