summaryrefslogtreecommitdiffstats
path: root/tests/ui/binding/use-uninit-match.rs
blob: 9250dbf0c43b443dc7a40ecffdb9fc85ca6ebe32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// run-pass
#![allow(dead_code)]
#![allow(non_camel_case_types)]


fn foo<T>(o: myoption<T>) -> isize {
    let mut x: isize = 5;
    match o {
        myoption::none::<T> => { }
        myoption::some::<T>(_t) => { x += 1; }
    }
    return x;
}

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

pub fn main() { println!("{}", 5); }