rust/tests/ui/for-loop-while/auto-loop.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
156 B
Rust
Raw Normal View History

//@ run-pass
pub fn main() {
2015-01-25 15:05:03 -06:00
let mut sum = 0;
let xs = vec![1, 2, 3, 4, 5];
2015-01-31 11:20:46 -06:00
for x in &xs {
sum += *x;
}
assert_eq!(sum, 15);
}