fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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