summaryrefslogtreecommitdiffstats
path: root/src/test/ui/nll/user-annotations/wf-self-type.rs
blob: 539226aabd722b9fdd628eaf86bde695cb937979 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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::xmute(u) //~ ERROR lifetime may not live long enough
}

fn main() {}