diff options
Diffstat (limited to 'src/test/ui/regions/issue-28848.rs')
-rw-r--r-- | src/test/ui/regions/issue-28848.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/regions/issue-28848.rs b/src/test/ui/regions/issue-28848.rs new file mode 100644 index 000000000..0eb3d89c5 --- /dev/null +++ b/src/test/ui/regions/issue-28848.rs @@ -0,0 +1,14 @@ +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) + //~^ ERROR lifetime may not live long enough +} + +fn main() {} |