rust/tests/ui/regions/issue-28848.rs

15 lines
267 B
Rust
Raw Normal View History

struct Foo<'a, 'b: 'a>(&'a &'b ());
impl<'a, 'b> Foo<'a, 'b> {
fn xmute(a: &'b ()) -> &'a () {
unreachable!()
}
}
pub fn foo<'a, 'b>(u: &'b ()) -> &'a () {
Foo::<'a, 'b>::xmute(u)
2022-04-01 12:13:25 -05:00
//~^ ERROR lifetime may not live long enough
}
fn main() {}