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