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