rust/tests/ui/issues/issue-51515.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
343 B
Rust
Raw Normal View History

2018-07-09 20:16:02 +00:00
fn main() {
let foo = &16;
2018-07-09 20:33:57 +00:00
//~^ HELP consider changing this to be a mutable reference
2018-07-09 20:16:02 +00:00
*foo = 32;
//~^ ERROR cannot assign to `*foo`, which is behind a `&` reference
2018-07-09 20:16:02 +00:00
let bar = foo;
//~^ HELP consider specifying this binding's type
2018-07-09 20:16:02 +00:00
*bar = 64;
//~^ ERROR cannot assign to `*bar`, which is behind a `&` reference
2018-07-09 20:16:02 +00:00
}