rust/src/test/run-pass/loop-scope.rs

7 lines
119 B
Rust
Raw Normal View History

fn main() {
let x = ~[10, 20, 30];
let mut sum = 0;
2012-06-30 18:19:07 -05:00
for x.each |x| { sum += x; }
2011-07-27 07:19:39 -05:00
assert (sum == 60);
}