rust/tests/ui/nll/issue-47388.rs

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

11 lines
197 B
Rust
Raw Normal View History

2018-03-10 12:55:23 -06:00
struct FancyNum {
num: u8,
}
fn main() {
let mut fancy = FancyNum{ num: 5 };
let fancy_ref = &(&mut fancy);
2018-04-06 12:33:20 -05:00
fancy_ref.num = 6; //~ ERROR E0594
2018-03-10 12:55:23 -06:00
println!("{}", fancy_ref.num);
2018-03-10 13:27:03 -06:00
}