Bless tests and update ERROR
This commit is contained in:
parent
7a70140ed5
commit
323df7b504
@ -12,5 +12,6 @@
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let ref my_ref @ _ = 0;
|
let ref my_ref @ _ = 0;
|
||||||
*my_ref = 0; //~ ERROR cannot assign to data in a `&` reference [E0594]
|
*my_ref = 0;
|
||||||
|
//~^ ERROR cannot assign to `*my_ref` which is behind a `&` reference [E0594]
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
error[E0594]: cannot assign to data in a `&` reference
|
error[E0594]: cannot assign to `*my_ref` which is behind a `&` reference
|
||||||
--> $DIR/issue-51244.rs:15:5
|
--> $DIR/issue-51244.rs:15:5
|
||||||
|
|
|
|
||||||
LL | let ref my_ref @ _ = 0;
|
LL | let ref my_ref @ _ = 0;
|
||||||
| -------------- help: consider changing this to be a mutable reference: `&mut ef my_ref @ _`
|
| -------------- help: consider changing this to be a mutable reference: `ref mut my_ref @ _`
|
||||||
LL | *my_ref = 0; //~ ERROR cannot assign to data in a `&` reference [E0594]
|
LL | *my_ref = 0;
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^ `my_ref` is a `&` reference, so the data it refers to cannot be written
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user