2011-05-26 16:02:25 -07:00
|
|
|
// -*- rust -*-
|
2011-08-12 15:42:39 -07:00
|
|
|
fn foo(c: [int]) {
|
2011-07-27 14:19:39 +02:00
|
|
|
let a: int = 5;
|
2012-03-22 08:39:41 -07:00
|
|
|
let mut b: [int] = [];
|
2011-05-26 16:02:25 -07:00
|
|
|
|
2011-07-27 14:19:39 +02:00
|
|
|
|
2011-08-13 00:10:18 -07:00
|
|
|
alt none::<int> {
|
2011-12-22 14:42:52 -08:00
|
|
|
some::<int>(_) {
|
|
|
|
for i: int in c {
|
2011-12-22 17:53:53 -08:00
|
|
|
log(debug, a);
|
2011-12-22 14:42:52 -08:00
|
|
|
let a = 17;
|
|
|
|
b += [a];
|
|
|
|
}
|
|
|
|
}
|
2011-08-19 15:16:48 -07:00
|
|
|
_ { }
|
2011-05-26 16:02:25 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-01-19 18:31:08 -08:00
|
|
|
enum t<T> { none, some(T), }
|
2011-05-26 16:02:25 -07:00
|
|
|
|
2011-08-19 15:16:48 -07:00
|
|
|
fn main() { let x = 10; let x = x + 20; assert (x == 30); foo([]); }
|