]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr
Change NLL compare mode to borrowck=migrate.
[rust.git] / src / test / ui / lifetimes / lifetime-errors / ex3-both-anon-regions-using-trait-objects.nll.stderr
1 error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
2   --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:11:3
3    |
4 LL | fn foo(x:Box<Fn(&u8, &u8)> , y: Vec<&u8>, z: &u8) {
5    |                              - help: consider changing this to be mutable: `mut y`
6 LL |   y.push(z); //~ ERROR lifetime mismatch
7    |   ^ cannot borrow as mutable
8
9 error: unsatisfied lifetime constraints
10   --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:11:3
11    |
12 LL | fn foo(x:Box<Fn(&u8, &u8)> , y: Vec<&u8>, z: &u8) {
13    |                                     -        - let's call the lifetime of this reference `'1`
14    |                                     |
15    |                                     let's call the lifetime of this reference `'2`
16 LL |   y.push(z); //~ ERROR lifetime mismatch
17    |   ^^^^^^^^^ argument requires that `'1` must outlive `'2`
18
19 error: aborting due to 2 previous errors
20
21 For more information about this error, try `rustc --explain E0596`.