]> git.lizzy.rs Git - rust.git/blob - src/test/ui/span/borrowck-object-mutability.stderr
reduce spans for `unsafe impl` errors
[rust.git] / src / test / ui / span / borrowck-object-mutability.stderr
1 error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
2   --> $DIR/borrowck-object-mutability.rs:8:5
3    |
4 LL |     x.borrowed_mut();
5    |     ^^^^^^^^^^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
6    |
7 help: consider changing this to be a mutable reference
8    |
9 LL | fn borrowed_receiver(x: &mut dyn Foo) {
10    |                         ~~~~~~~~~~~~
11
12 error[E0596]: cannot borrow `*x` as mutable, as `x` is not declared as mutable
13   --> $DIR/borrowck-object-mutability.rs:18:5
14    |
15 LL | fn owned_receiver(x: Box<dyn Foo>) {
16    |                   - help: consider changing this to be mutable: `mut x`
17 LL |     x.borrowed();
18 LL |     x.borrowed_mut();
19    |     ^^^^^^^^^^^^^^^^ cannot borrow as mutable
20
21 error: aborting due to 2 previous errors
22
23 For more information about this error, try `rustc --explain E0596`.