Bless tests and update ERROR
This commit is contained in:
parent
7a70140ed5
commit
323df7b504
2 changed files with 6 additions and 5 deletions
|
@ -12,5 +12,6 @@
|
|||
|
||||
fn main() {
|
||||
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
|
||||
|
|
||||
LL | let ref my_ref @ _ = 0;
|
||||
| -------------- help: consider changing this to be a mutable reference: `&mut ef my_ref @ _`
|
||||
LL | *my_ref = 0; //~ ERROR cannot assign to data in a `&` reference [E0594]
|
||||
| ^^^^^^^^^^^
|
||||
| -------------- help: consider changing this to be a mutable reference: `ref mut my_ref @ _`
|
||||
LL | *my_ref = 0;
|
||||
| ^^^^^^^^^^^ `my_ref` is a `&` reference, so the data it refers to cannot be written
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue