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

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

10 lines
178 B
Rust
Raw Normal View History

// run-pass
struct Pair { x: isize, y: isize }
pub fn main() {
for elt in &(vec![Pair {x: 10, y: 20}, Pair {x: 30, y: 0}]) {
assert_eq!(elt.x + elt.y, 30);
2011-08-01 08:46:17 -05:00
}
}