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 18:55:23 +00:00
struct FancyNum {
num: u8,
}
fn main() {
let mut fancy = FancyNum{ num: 5 };
let fancy_ref = &(&mut fancy);
2018-04-06 17:33:20 +00:00
fancy_ref.num = 6; //~ ERROR E0594
2018-03-10 18:55:23 +00:00
println!("{}", fancy_ref.num);
2018-03-10 19:27:03 +00:00
}