compiler/rustc_error_codes/src/error_codes/E0025.md MARKDOWN 35 lines View on github.com → Search inside
1Each field of a struct can only be bound once in a pattern.23Erroneous code example:45```compile_fail,E00256struct Foo {7    a: u8,8    b: u8,9}1011fn main(){12    let x = Foo { a:1, b:2 };1314    let Foo { a: x, a: y } = x;15    // error: field `a` bound multiple times in the pattern16}17```1819Each occurrence of a field name binds the value of that field, so to fix this20error you will have to remove or alter the duplicate uses of the field name.21Perhaps you misspelled another field name? Example:2223```24struct Foo {25    a: u8,26    b: u8,27}2829fn main(){30    let x = Foo { a:1, b:2 };3132    let Foo { a: x, b: y } = x; // ok!33}34```

Findings

✓ No findings reported for this file.

Get this view in your editor

Same data, no extra tab — call code_get_file + code_get_findings over MCP from Claude/Cursor/Copilot.