]>
Commit | Line | Data |
---|---|---|
923072b8 FG |
1 | error: lifetime may not live long enough |
2 | --> $DIR/ex3-both-anon-regions-using-fn-items.rs:2:3 | |
ea8adc8c | 3 | | |
0531ce1d | 4 | LL | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) { |
923072b8 FG |
5 | | - - let's call the lifetime of this reference `'1` |
6 | | | | |
7 | | let's call the lifetime of this reference `'2` | |
532ac7d7 | 8 | LL | y.push(z); |
923072b8 | 9 | | ^^^^^^^^^ argument requires that `'1` must outlive `'2` |
3c0e092e | 10 | | |
3c0e092e XL |
11 | help: consider introducing a named lifetime parameter |
12 | | | |
13 | LL | fn foo<'a>(x:fn(&u8, &u8), y: Vec<&'a u8>, z: &'a u8) { | |
14 | | ++++ ++ ++ | |
ea8adc8c | 15 | |
923072b8 FG |
16 | error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable |
17 | --> $DIR/ex3-both-anon-regions-using-fn-items.rs:2:3 | |
18 | | | |
19 | LL | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) { | |
20 | | - help: consider changing this to be mutable: `mut y` | |
21 | LL | y.push(z); | |
22 | | ^^^^^^^^^ cannot borrow as mutable | |
23 | ||
24 | error: aborting due to 2 previous errors | |
ea8adc8c | 25 | |
923072b8 | 26 | For more information about this error, try `rustc --explain E0596`. |