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

6 lines
111 B
Rust
Raw Normal View History

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