rust/src/test/ui/lifetimes/issue-90170-elision-mismatch.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
2.1 KiB
Plaintext
Raw Normal View History

error[E0623]: lifetime mismatch
2022-05-22 06:05:15 +00:00
--> $DIR/issue-90170-elision-mismatch.rs:8:47
|
LL | pub fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); }
| --- --- ^ ...but data from `y` flows into `x` here
| |
| these two types are declared with different lifetimes...
|
= note: each elided lifetime in input position becomes a distinct lifetime
help: consider introducing a named lifetime parameter
|
LL | pub fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
| ++++ ++ ++
error[E0623]: lifetime mismatch
2022-05-22 06:05:15 +00:00
--> $DIR/issue-90170-elision-mismatch.rs:10:51
|
LL | pub fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); }
| ------ --- ^ ...but data from `y` flows into `x` here
| |
| these two types are declared with different lifetimes...
|
= note: each elided lifetime in input position becomes a distinct lifetime
help: consider introducing a named lifetime parameter
|
LL | pub fn foo2<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
| ++++ ~~ ++
error[E0623]: lifetime mismatch
2022-05-22 06:05:15 +00:00
--> $DIR/issue-90170-elision-mismatch.rs:12:70
|
LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&u8>, y: &u8) { x.push(y); }
| --- --- ^ ...but data from `y` flows into `x` here
| |
| these two types are declared with different lifetimes...
|
= note: each elided lifetime in input position becomes a distinct lifetime
help: consider introducing a named lifetime parameter
|
LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
| ++ ++
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0623`.