]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/pattern/bindings-after-at/pat-at-same-name-both.rs
1 // Test that `binding @ subpat` acts as a product context with respect to duplicate binding names.
2 // The code that is tested here lives in resolve (see `resolve_pattern_inner`).
7 //~^ ERROR identifier `a` is bound more than once in this parameter list
8 //~| ERROR identifier `a` is bound more than once in this parameter list
12 //~^ ERROR identifier `a` is bound more than once in the same pattern
14 //~^ ERROR identifier `a` is bound more than once in the same pattern
19 //~^ ERROR identifier `a` is bound more than once in the same pattern
20 //~| ERROR identifier `a` is bound more than once in the same pattern
21 let ref a @
ref a
= ();
22 //~^ ERROR identifier `a` is bound more than once in the same pattern
23 let ref mut a @
ref mut a
= ();
24 //~^ ERROR identifier `a` is bound more than once in the same pattern
26 let a @
(Ok(a
) | Err(a
)) = Ok(());
27 //~^ ERROR identifier `a` is bound more than once in the same pattern
28 //~| ERROR identifier `a` is bound more than once in the same pattern