mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
da1360d981
Partially address #45405.
12 lines
371 B
Rust
12 lines
371 B
Rust
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 specifying this binding's type
|
|
*bar = 64;
|
|
//~^ ERROR cannot assign to `*bar`, which is behind a `&` reference
|
|
}
|