rust/src/test/ui/lifetimes/issue-90170-elision-mismatch.rs
Nilstrieb 4b9e4606cb Add beginner friendly lifetime elision hint to E0623
Suggest adding a new lifetime parameter when two elided lifetimes should match up but don't

Issue #90170

This also changes the tests introduced by the previous commits because of another rustc issue (#90258)
2021-11-03 20:10:44 +01:00

10 lines
299 B
Rust

// run-rustfix
pub fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); } //~ ERROR lifetime mismatch
pub fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); } //~ ERROR lifetime mismatch
pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&u8>, y: &u8) { x.push(y); } //~ ERROR lifetime mismatch
fn main() {}