fork/rust

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

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

master
1.6 KiB47 linesraw
1error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
2  --> $DIR/borrowck-borrow-overloaded-deref-mut.rs:29:25
3   |
4LL |     let __isize = &mut *x;
5   |                         ^ cannot borrow as mutable
6   |
7help: consider changing this to be mutable
8   |
9LL | fn deref_mut1(mut x: Own<isize>) {
10   |               +++
11
12error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
13  --> $DIR/borrowck-borrow-overloaded-deref-mut.rs:41:11
14   |
15LL |     &mut **x
16   |           ^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
17   |
18help: consider changing this to be a mutable reference
19   |
20LL | fn deref_extend_mut1<'a>(x: &'a mut Own<isize>) -> &'a mut isize {
21   |                                 +++
22
23error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
24  --> $DIR/borrowck-borrow-overloaded-deref-mut.rs:49:6
25   |
26LL |     *x = 3;
27   |      ^ cannot borrow as mutable
28   |
29help: consider changing this to be mutable
30   |
31LL | fn assign1<'a>(mut x: Own<isize>) {
32   |                +++
33
34error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
35  --> $DIR/borrowck-borrow-overloaded-deref-mut.rs:53:6
36   |
37LL |     **x = 3;
38   |      ^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
39   |
40help: consider changing this to be a mutable reference
41   |
42LL | fn assign2<'a>(x: &'a mut Own<isize>) {
43   |                       +++
44
45error: aborting due to 4 previous errors
46
47For more information about this error, try `rustc --explain E0596`.