2016-08-06 14:44:49 -05:00
|
|
|
struct FancyNum {
|
|
|
|
num: u8,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut fancy = FancyNum{ num: 5 };
|
|
|
|
let fancy_ref = &(&mut fancy);
|
2021-07-02 11:29:49 -05:00
|
|
|
fancy_ref.num = 6; //~ ERROR cannot assign to `fancy_ref.num`, which is behind a `&` reference
|
2016-08-06 14:44:49 -05:00
|
|
|
println!("{}", fancy_ref.num);
|
|
|
|
}
|