]> git.proxmox.com Git - rustc.git/blame - src/test/ui/span/borrowck-object-mutability.stderr
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / span / borrowck-object-mutability.stderr
CommitLineData
48663c56 1error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
0731742a 2 --> $DIR/borrowck-object-mutability.rs:8:5
476ff2be 3 |
dc9dc135
XL
4LL | fn borrowed_receiver(x: &dyn Foo) {
5 | -------- help: consider changing this to be a mutable reference: `&mut dyn Foo`
0531ce1d 6LL | x.borrowed();
532ac7d7 7LL | x.borrowed_mut();
c295e0f8 8 | ^^^^^^^^^^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
476ff2be 9
48663c56 10error[E0596]: cannot borrow `*x` as mutable, as `x` is not declared as mutable
0731742a 11 --> $DIR/borrowck-object-mutability.rs:18:5
476ff2be 12 |
dc9dc135 13LL | fn owned_receiver(x: Box<dyn Foo>) {
48663c56 14 | - help: consider changing this to be mutable: `mut x`
0531ce1d 15LL | x.borrowed();
532ac7d7 16LL | x.borrowed_mut();
c295e0f8 17 | ^^^^^^^^^^^^^^^^ cannot borrow as mutable
476ff2be 18
041b39d2 19error: aborting due to 2 previous errors
476ff2be 20
0531ce1d 21For more information about this error, try `rustc --explain E0596`.