summaryrefslogtreecommitdiffstats
path: root/tests/ui/codegen/issue-16602-2.rs
blob: 6364630ffa94db8d5c69d5519c6d2a26f2f255a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// run-pass
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);
}