1 error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
2 --> $DIR/borrowck-object-mutability.rs:8:5
5 | ^^^^^^^^^^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
7 help: consider changing this to be a mutable reference
9 LL | fn borrowed_receiver(x: &mut dyn Foo) {
12 error[E0596]: cannot borrow `*x` as mutable, as `x` is not declared as mutable
13 --> $DIR/borrowck-object-mutability.rs:18:5
15 LL | fn owned_receiver(x: Box<dyn Foo>) {
16 | - help: consider changing this to be mutable: `mut x`
18 LL | x.borrowed_mut();
19 | ^^^^^^^^^^^^^^^^ cannot borrow as mutable
21 error: aborting due to 2 previous errors
23 For more information about this error, try `rustc --explain E0596`.