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
155 B
Rust
Raw Normal View History

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