os-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 Permalink 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 08:37:42 -07:00
match o {
myoption::none::<T> => { }
myoption::some::<T>(_t) => { x += 1; }
2013-08-17 08:37:42 -07:00
}
2012-08-01 17:30:05 -07:00
return x;
}
enum myoption<T> { none, some(T), }
2015-01-25 22:05:03 +01:00
pub fn main() { println!("{}", 5); }