diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-15260.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-15260.rs b/src/test/ui/issues/issue-15260.rs new file mode 100644 index 000000000..64fc3df3d --- /dev/null +++ b/src/test/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 }; +} |