rust/tests/ui/binding/use-uninit-match.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
324 B
Rust
Raw Normal View History

//@ run-pass
#![allow(dead_code)]
#![allow(non_camel_case_types)]
fn foo<T>(o: myoption<T>) -> isize {
let mut x: isize = 5;
2013-08-17 15:37:42 +00:00
match o {
myoption::none::<T> => { }
myoption::some::<T>(_t) => { x += 1; }
2013-08-17 15:37:42 +00:00
}
2012-08-02 00:30:05 +00:00
return x;
}
enum myoption<T> { none, some(T), }
2015-01-25 21:05:03 +00:00
pub fn main() { println!("{}", 5); }