]> git.lizzy.rs Git - rust.git/blob - tests/ui/binding/shadow.rs
Rollup merge of #106692 - eggyal:mv-binary_heap.rs-binary_heap/mod.rs, r=Mark-Simulacrum
[rust.git] / tests / 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()); }