2017-05-02 13:33:10 -04:00
|
|
|
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 () {
|
2022-04-19 12:56:18 +02:00
|
|
|
Foo::<'a, 'b>::xmute(u)
|
2022-04-01 13:13:25 -04:00
|
|
|
//~^ ERROR lifetime may not live long enough
|
2017-05-02 13:33:10 -04:00
|
|
|
}
|
|
|
|
|
2017-12-30 02:25:40 +08:00
|
|
|
fn main() {}
|