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