summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-51515.rs
blob: 797c1085d517b1b44b9159f6252a29399d92c328 (plain)
1
2
3
4
5
6
7
8
9
10
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;
    *bar = 64;
    //~^ ERROR cannot assign to `*bar`, which is behind a `&` reference
}