]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lifetimes/issue-90170-elision-mismatch.stderr
Rollup merge of #90498 - joshtriplett:target-tier-policy-draft-updates, r=Mark-Simulacrum
[rust.git] / src / test / ui / lifetimes / issue-90170-elision-mismatch.stderr
1 error[E0623]: lifetime mismatch
2   --> $DIR/issue-90170-elision-mismatch.rs:3:47
3    |
4 LL | pub fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); }
5    |                        ---      ---           ^ ...but data from `y` flows into `x` here
6    |                                 |
7    |                                 these two types are declared with different lifetimes...
8    |
9    = note: each elided lifetime in input position becomes a distinct lifetime
10 help: consider introducing a named lifetime parameter
11    |
12 LL | pub fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
13    |           ++++              ++          ++
14
15 error[E0623]: lifetime mismatch
16   --> $DIR/issue-90170-elision-mismatch.rs:5:51
17    |
18 LL | pub fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); }
19    |                         ------      ---           ^ ...but data from `y` flows into `x` here
20    |                                     |
21    |                                     these two types are declared with different lifetimes...
22    |
23    = note: each elided lifetime in input position becomes a distinct lifetime
24 help: consider introducing a named lifetime parameter
25    |
26 LL | pub fn foo2<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
27    |            ++++              ~~          ++
28
29 error[E0623]: lifetime mismatch
30   --> $DIR/issue-90170-elision-mismatch.rs:7:70
31    |
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
34    |                                                        |
35    |                                                        these two types are declared with different lifetimes...
36    |
37    = note: each elided lifetime in input position becomes a distinct lifetime
38 help: consider introducing a named lifetime parameter
39    |
40 LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
41    |                                                ++          ++
42
43 error: aborting due to 3 previous errors
44
45 For more information about this error, try `rustc --explain E0623`.