File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1212
1313fn main ( ) {
1414 let ref my_ref @ _ = 0 ;
15- * my_ref = 0 ; //~ ERROR cannot assign to data in a `&` reference [E0594]
15+ * my_ref = 0 ;
16+ //~^ ERROR cannot assign to `*my_ref` which is behind a `&` reference [E0594]
1617}
Original file line number Diff line number Diff line change 1- error[E0594]: cannot assign to data in a `&` reference
1+ error[E0594]: cannot assign to `*my_ref` which is behind a `&` reference
22 --> $DIR/issue-51244.rs:15:5
33 |
44LL | let ref my_ref @ _ = 0;
5- | -------------- help: consider changing this to be a mutable reference: `&mut ef my_ref @ _`
6- LL | *my_ref = 0; //~ ERROR cannot assign to data in a `&` reference [E0594]
7- | ^^^^^^^^^^^
5+ | -------------- help: consider changing this to be a mutable reference: `ref mut my_ref @ _`
6+ LL | *my_ref = 0;
7+ | ^^^^^^^^^^^ `my_ref` is a `&` reference, so the data it refers to cannot be written
88
99error: aborting due to previous error
1010
You can’t perform that action at this time.
0 commit comments