rust/src/test/ui/issues/issue-51515.rs
2018-12-25 21:08:33 -07:00

15 lines
425 B
Rust

#![feature(nll)]
fn main() {
let foo = &16;
//~^ HELP consider changing this to be a mutable reference
//~| SUGGESTION &mut 16
*foo = 32;
//~^ ERROR cannot assign to `*foo` which is behind a `&` reference
let bar = foo;
//~^ HELP consider changing this to be a mutable reference
//~| SUGGESTION &mut i32
*bar = 64;
//~^ ERROR cannot assign to `*bar` which is behind a `&` reference
}