2018-07-09 13:16:02 -07:00
|
|
|
fn main() {
|
|
|
|
let foo = &16;
|
2018-07-09 13:33:57 -07:00
|
|
|
//~^ HELP consider changing this to be a mutable reference
|
|
|
|
//~| SUGGESTION &mut 16
|
2018-07-09 13:16:02 -07:00
|
|
|
*foo = 32;
|
2021-07-02 18:29:49 +02:00
|
|
|
//~^ ERROR cannot assign to `*foo`, which is behind a `&` reference
|
2018-07-09 13:16:02 -07:00
|
|
|
let bar = foo;
|
2023-02-03 18:53:27 +00:00
|
|
|
//~^ HELP consider specifying this binding's type
|
2018-07-09 13:16:02 -07:00
|
|
|
*bar = 64;
|
2021-07-02 18:29:49 +02:00
|
|
|
//~^ ERROR cannot assign to `*bar`, which is behind a `&` reference
|
2018-07-09 13:16:02 -07:00
|
|
|
}
|