Files
rust/tests/ui/pattern/struct-field-duplicate-binding-15260.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
578 B
Rust
Raw Normal View History

2025-07-24 19:07:20 +05:00
//! Regression test for https://github.com/rust-lang/rust/issues/15260
struct Foo {
a: usize,
}
fn main() {
let Foo {
a: _,
2016-09-26 13:00:37 -07:00
a: _
//~^ ERROR field `a` bound multiple times in the pattern
} = Foo { a: 29 };
let Foo {
a,
2016-09-26 13:00:37 -07:00
a: _
//~^ ERROR field `a` bound multiple times in the pattern
} = Foo { a: 29 };
let Foo {
2016-09-26 13:00:37 -07:00
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 };
}