about summary refs log tree commit diff
path: root/tests/ui/binding/struct-destructuring-repeated-bindings-9725.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/binding/struct-destructuring-repeated-bindings-9725.rs')
-rw-r--r--tests/ui/binding/struct-destructuring-repeated-bindings-9725.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/binding/struct-destructuring-repeated-bindings-9725.rs b/tests/ui/binding/struct-destructuring-repeated-bindings-9725.rs
new file mode 100644
index 00000000000..6b0b8e37b8c
--- /dev/null
+++ b/tests/ui/binding/struct-destructuring-repeated-bindings-9725.rs
@@ -0,0 +1,8 @@
+// https://github.com/rust-lang/rust/issues/9725
+struct A { foo: isize }
+
+fn main() {
+    let A { foo, foo } = A { foo: 3 };
+    //~^ ERROR: identifier `foo` is bound more than once in the same pattern
+    //~^^ ERROR: field `foo` bound multiple times
+}