mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 14:01:51 +00:00
11 lines
343 B
Rust
11 lines
343 B
Rust
fn main() {
|
|
let foo = &16;
|
|
//~^ HELP consider changing this to be a mutable reference
|
|
*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
|
|
}
|