File tree 2 files changed +6
-5
lines changed
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 12
12
13
13
fn main ( ) {
14
14
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]
16
17
}
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
2
2
--> $DIR/issue-51244.rs:15:5
3
3
|
4
4
LL | 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
8
8
9
9
error: aborting due to previous error
10
10
You can’t perform that action at this time.
0 commit comments