rust/tests/ui/lifetimes/issue-90170-elision-mismatch.rs

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

10 lines
347 B
Rust
Raw Normal View History

// run-rustfix
2022-04-01 17:13:25 +00:00
pub fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); } //~ ERROR lifetime may not live long enough
2022-04-01 17:13:25 +00:00
pub fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); } //~ ERROR lifetime may not live long enough
2022-04-01 17:13:25 +00:00
pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&u8>, y: &u8) { x.push(y); } //~ ERROR lifetime may not live long enough
fn main() {}