mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
13 lines
193 B
Rust
13 lines
193 B
Rust
//@ 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);
|
|
}
|