error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:63:24 | LL | fn deref_mut_field1(x: Own) { | - help: consider changing this to be mutable: `mut x` LL | let __isize = &mut x.y; //~ ERROR cannot borrow | ^ cannot borrow as mutable error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:75:10 | LL | fn deref_extend_mut_field1(x: &Own) -> &mut isize { | ----------- help: consider changing this to be a mutable reference: `&mut Own` LL | &mut x.y //~ ERROR cannot borrow | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:98:5 | LL | fn assign_field1<'a>(x: Own) { | - help: consider changing this to be mutable: `mut x` LL | x.y = 3; //~ ERROR cannot borrow | ^ cannot borrow as mutable error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:102:5 | LL | fn assign_field2<'a>(x: &'a Own) { | -------------- help: consider changing this to be a mutable reference: `&'a mut Own` LL | x.y = 3; //~ ERROR cannot borrow | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:119:5 | LL | fn deref_mut_method1(x: Own) { | - help: consider changing this to be mutable: `mut x` LL | x.set(0, 0); //~ ERROR cannot borrow | ^ cannot borrow as mutable error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:131:5 | LL | fn deref_extend_mut_method1(x: &Own) -> &mut isize { | ----------- help: consider changing this to be a mutable reference: `&mut Own` LL | x.y_mut() //~ ERROR cannot borrow | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:139:6 | LL | fn assign_method1<'a>(x: Own) { | - help: consider changing this to be mutable: `mut x` LL | *x.y_mut() = 3; //~ ERROR cannot borrow | ^ cannot borrow as mutable error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:143:6 | LL | fn assign_method2<'a>(x: &'a Own) { | -------------- help: consider changing this to be a mutable reference: `&'a mut Own` LL | *x.y_mut() = 3; //~ ERROR cannot borrow | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable error: aborting due to 8 previous errors For more information about this error, try `rustc --explain E0596`.