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

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 13:46:17 +00:00
}
}