2019-07-26 21:54:25 +00:00
|
|
|
// run-pass
|
|
|
|
|
2018-09-14 10:20:28 +00:00
|
|
|
#![allow(non_camel_case_types)]
|
|
|
|
#![allow(dead_code)]
|
2015-03-26 00:06:52 +00:00
|
|
|
fn foo(c: Vec<isize> ) {
|
|
|
|
let a: isize = 5;
|
|
|
|
let mut b: Vec<isize> = Vec::new();
|
2011-05-26 23:02:25 +00:00
|
|
|
|
2011-07-27 12:19:39 +00:00
|
|
|
|
2015-03-26 00:06:52 +00:00
|
|
|
match t::none::<isize> {
|
|
|
|
t::some::<isize>(_) => {
|
2015-01-31 17:20:46 +00:00
|
|
|
for _i in &c {
|
2014-10-15 01:07:11 +00:00
|
|
|
println!("{}", a);
|
2015-01-25 21:05:03 +00:00
|
|
|
let a = 17;
|
2013-06-12 02:13:42 +00:00
|
|
|
b.push(a);
|
2013-06-21 12:29:53 +00:00
|
|
|
}
|
2011-12-22 22:42:52 +00:00
|
|
|
}
|
2013-06-21 12:29:53 +00:00
|
|
|
_ => { }
|
2011-05-26 23:02:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-01-20 02:31:08 +00:00
|
|
|
enum t<T> { none, some(T), }
|
2011-05-26 23:02:25 +00:00
|
|
|
|
2015-06-07 18:00:38 +00:00
|
|
|
pub fn main() { let x = 10; let x = x + 20; assert_eq!(x, 30); foo(Vec::new()); }
|