Files
rust/src/test/codegen/iterate-over-array.rs
T
2013-07-16 17:44:57 -07:00

11 lines
154 B
Rust

#[no_mangle]
fn test(x: &[int]) -> int {
let mut y = 0;
let mut i = 0;
while (i < x.len()) {
y += x[i];
i += 1;
}
y
}