1 error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
2 --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:53:24
4 LL | fn deref_mut_field1(x: Own<Point>) {
5 | - help: consider changing this to be mutable: `mut x`
6 LL | let __isize = &mut x.y;
7 | ^ cannot borrow as mutable
9 error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
10 --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:65:10
12 LL | fn deref_extend_mut_field1(x: &Own<Point>) -> &mut isize {
13 | ----------- help: consider changing this to be a mutable reference: `&mut Own<Point>`
15 | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
17 error[E0499]: cannot borrow `*x` as mutable more than once at a time
18 --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:78:19
20 LL | let _x = &mut x.x;
21 | - first mutable borrow occurs here
22 LL | let _y = &mut x.y;
23 | ^ second mutable borrow occurs here
25 | -- first borrow later used here
27 error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
28 --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:88:5
30 LL | fn assign_field1<'a>(x: Own<Point>) {
31 | - help: consider changing this to be mutable: `mut x`
33 | ^ cannot borrow as mutable
35 error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
36 --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:92:5
38 LL | fn assign_field2<'a>(x: &'a Own<Point>) {
39 | -------------- help: consider changing this to be a mutable reference: `&'a mut Own<Point>`
41 | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
43 error[E0499]: cannot borrow `*x` as mutable more than once at a time
44 --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:101:5
46 LL | let _p: &mut Point = &mut **x;
47 | -- first mutable borrow occurs here
49 | ^ second mutable borrow occurs here
51 | -- first borrow later used here
53 error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
54 --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:109:5
56 LL | fn deref_mut_method1(x: Own<Point>) {
57 | - help: consider changing this to be mutable: `mut x`
59 | ^^^^^^^^^^^ cannot borrow as mutable
61 error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
62 --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:121:5
64 LL | fn deref_extend_mut_method1(x: &Own<Point>) -> &mut isize {
65 | ----------- help: consider changing this to be a mutable reference: `&mut Own<Point>`
67 | ^^^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
69 error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
70 --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:129:6
72 LL | fn assign_method1<'a>(x: Own<Point>) {
73 | - help: consider changing this to be mutable: `mut x`
75 | ^^^^^^^^^ cannot borrow as mutable
77 error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
78 --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:133:6
80 LL | fn assign_method2<'a>(x: &'a Own<Point>) {
81 | -------------- help: consider changing this to be a mutable reference: `&'a mut Own<Point>`
83 | ^^^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
85 error: aborting due to 10 previous errors
87 Some errors have detailed explanations: E0499, E0596.
88 For more information about an error, try `rustc --explain E0499`.