1 error[E0623]: lifetime mismatch
2 --> $DIR/issue-90170-elision-mismatch.rs:3:47
4 LL | pub fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); }
5 | --- --- ^ ...but data from `y` flows into `x` here
7 | these two types are declared with different lifetimes...
9 = note: each elided lifetime in input position becomes a distinct lifetime
10 help: consider introducing a named lifetime parameter
12 LL | pub fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
15 error[E0623]: lifetime mismatch
16 --> $DIR/issue-90170-elision-mismatch.rs:5:51
18 LL | pub fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); }
19 | ------ --- ^ ...but data from `y` flows into `x` here
21 | these two types are declared with different lifetimes...
23 = note: each elided lifetime in input position becomes a distinct lifetime
24 help: consider introducing a named lifetime parameter
26 LL | pub fn foo2<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
29 error[E0623]: lifetime mismatch
30 --> $DIR/issue-90170-elision-mismatch.rs:7:70
32 LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&u8>, y: &u8) { x.push(y); }
33 | --- --- ^ ...but data from `y` flows into `x` here
35 | these two types are declared with different lifetimes...
37 = note: each elided lifetime in input position becomes a distinct lifetime
38 help: consider introducing a named lifetime parameter
40 LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
43 error: aborting due to 3 previous errors
45 For more information about this error, try `rustc --explain E0623`.