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