]> git.proxmox.com Git - rustc.git/blob - src/test/ui/pattern/bindings-after-at/pat-at-same-name-both.rs
Update unsuspicious file list
[rustc.git] / 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`).
3
4
5 fn main() {
6 fn f(a @ a @ a: ()) {}
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
9
10 match Ok(0) {
11 Ok(a @ b @ a)
12 //~^ ERROR identifier `a` is bound more than once in the same pattern
13 | Err(a @ b @ a)
14 //~^ ERROR identifier `a` is bound more than once in the same pattern
15 => {}
16 }
17
18 let a @ a @ a = ();
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
25
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
29 }