summaryrefslogtreecommitdiffstats
path: root/tests/ui/binding/shadow.rs
blob: 2495c8f47e7e0439fbf51aa50a06f723fde4dfdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// run-pass

#![allow(non_camel_case_types)]
#![allow(dead_code)]
fn foo(c: Vec<isize> ) {
    let a: isize = 5;
    let mut b: Vec<isize> = Vec::new();


    match t::none::<isize> {
        t::some::<isize>(_) => {
            for _i in &c {
                println!("{}", a);
                let a = 17;
                b.push(a);
            }
        }
        _ => { }
    }
}

enum t<T> { none, some(T), }

pub fn main() { let x = 10; let x = x + 20; assert_eq!(x, 30); foo(Vec::new()); }