summary refs log tree commit diff
path: root/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr
blob: a61d49fc953dbd9eb2ba896d5eddccca5c8179b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
warning: not reporting region error due to nll
  --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:11:10
   |
LL |   y.push(z); //~ ERROR lifetime mismatch
   |          ^

error[E0623]: lifetime mismatch
  --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:11:3
   |
LL | fn foo(x:Box<Fn(&u8, &u8)> , y: Vec<&u8>, z: &u8) {
   |                 ---  --- these two types are declared with different lifetimes...
LL |   y.push(z); //~ ERROR lifetime mismatch
   |   ^ ...but data from `z` flows into `y` here

error[E0596]: cannot borrow immutable item `y` as mutable
  --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:11:3
   |
LL | fn foo(x:Box<Fn(&u8, &u8)> , y: Vec<&u8>, z: &u8) {
   |                              - help: consider changing this to be mutable: `mut y`
LL |   y.push(z); //~ ERROR lifetime mismatch
   |   ^ cannot borrow as mutable

error: aborting due to 2 previous errors

Some errors occurred: E0596, E0623.
For more information about an error, try `rustc --explain E0596`.