mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
11 lines
197 B
Rust
11 lines
197 B
Rust
struct FancyNum {
|
|
num: u8,
|
|
}
|
|
|
|
fn main() {
|
|
let mut fancy = FancyNum{ num: 5 };
|
|
let fancy_ref = &(&mut fancy);
|
|
fancy_ref.num = 6; //~ ERROR E0594
|
|
println!("{}", fancy_ref.num);
|
|
}
|