]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-51515.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-51515.rs
1 fn main() {
2 let foo = &16;
3 //~^ HELP consider changing this to be a mutable reference
4 //~| SUGGESTION &mut 16
5 *foo = 32;
6 //~^ ERROR cannot assign to `*foo`, which is behind a `&` reference
7 let bar = foo;
8 //~^ HELP consider changing this to be a mutable reference
9 //~| SUGGESTION &mut i32
10 *bar = 64;
11 //~^ ERROR cannot assign to `*bar`, which is behind a `&` reference
12 }