]>
Commit | Line | Data |
---|---|---|
136023e0 | 1 | error[E0594]: cannot assign to `**t1`, which is behind a `&` reference |
0731742a | 2 | --> $DIR/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs:9:5 |
b7449926 | 3 | | |
48663c56 | 4 | LL | let t1 = t0; |
064997fb | 5 | | -- consider changing this binding's type to be: `&mut &mut isize` |
48663c56 | 6 | LL | let p: &isize = &**t0; |
532ac7d7 | 7 | LL | **t1 = 22; |
48663c56 | 8 | | ^^^^^^^^^ `t1` is a `&` reference, so the data it refers to cannot be written |
b7449926 | 9 | |
48663c56 XL |
10 | error[E0502]: cannot borrow `**t0` as immutable because it is also borrowed as mutable |
11 | --> $DIR/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs:14:21 | |
b7449926 XL |
12 | | |
13 | LL | let t1 = &mut *t0; | |
48663c56 | 14 | | -------- mutable borrow occurs here |
532ac7d7 | 15 | LL | let p: &isize = &**t0; |
48663c56 | 16 | | ^^^^^ immutable borrow occurs here |
b7449926 | 17 | LL | **t1 = 22; |
48663c56 | 18 | | --------- mutable borrow later used here |
b7449926 | 19 | |
48663c56 XL |
20 | error[E0596]: cannot borrow `**t0` as mutable, as it is behind a `&` reference |
21 | --> $DIR/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs:19:26 | |
b7449926 XL |
22 | | |
23 | LL | fn foo4(t0: & &mut isize) { | |
48663c56 | 24 | | ------------ help: consider changing this to be a mutable reference: `&mut &mut isize` |
532ac7d7 | 25 | LL | let x: &mut isize = &mut **t0; |
48663c56 | 26 | | ^^^^^^^^^ `t0` is a `&` reference, so the data it refers to cannot be borrowed as mutable |
b7449926 XL |
27 | |
28 | error: aborting due to 3 previous errors | |
29 | ||
60c5eb7d | 30 | Some errors have detailed explanations: E0502, E0594, E0596. |
48663c56 | 31 | For more information about an error, try `rustc --explain E0502`. |