]> git.proxmox.com Git - rustc.git/blame - src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.stderr
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / lifetimes / lifetime-errors / ex3-both-anon-regions-using-fn-items.stderr
CommitLineData
923072b8
FG
1error: lifetime may not live long enough
2 --> $DIR/ex3-both-anon-regions-using-fn-items.rs:2:3
ea8adc8c 3 |
0531ce1d 4LL | 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 8LL | y.push(z);
923072b8 9 | ^^^^^^^^^ argument requires that `'1` must outlive `'2`
3c0e092e 10 |
3c0e092e
XL
11help: consider introducing a named lifetime parameter
12 |
13LL | fn foo<'a>(x:fn(&u8, &u8), y: Vec<&'a u8>, z: &'a u8) {
14 | ++++ ++ ++
ea8adc8c 15
923072b8
FG
16error[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 |
19LL | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) {
20 | - help: consider changing this to be mutable: `mut y`
21LL | y.push(z);
22 | ^^^^^^^^^ cannot borrow as mutable
23
24error: aborting due to 2 previous errors
ea8adc8c 25
923072b8 26For more information about this error, try `rustc --explain E0596`.