rust/tests/ui/codegen/issue-16602-2.rs

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

13 lines
193 B
Rust
Raw Normal View History

//@ run-pass
2015-04-11 07:13:24 +00:00
struct A {
pub x: u32,
pub y: u32,
}
fn main() {
let mut a = A { x: 1, y: 1 };
a = A { x: a.y * 2, y: a.x * 2 };
assert_eq!(a.x, 2);
assert_eq!(a.y, 2);
}