]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binding/shadow.rs
Auto merge of #99612 - yanchen4791:issue-95079-fix, r=compiler-errors
[rust.git] / src / test / ui / binding / shadow.rs
1 // run-pass
2
3 #![allow(non_camel_case_types)]
4 #![allow(dead_code)]
5 fn foo(c: Vec<isize> ) {
6     let a: isize = 5;
7     let mut b: Vec<isize> = Vec::new();
8
9
10     match t::none::<isize> {
11         t::some::<isize>(_) => {
12             for _i in &c {
13                 println!("{}", a);
14                 let a = 17;
15                 b.push(a);
16             }
17         }
18         _ => { }
19     }
20 }
21
22 enum t<T> { none, some(T), }
23
24 pub fn main() { let x = 10; let x = x + 20; assert_eq!(x, 30); foo(Vec::new()); }