about summary refs log tree commit diff
path: root/tests/ui/implied-bounds/implied-bounds-on-nested-references-plus-variance.rs
blob: 6de81cba7281a76f4b4c91c764585cdcffb92c16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Regression test for #129021.

static UNIT: &'static &'static () = &&();

fn foo<'a, 'b, T>(_: &'a &'b (), v: &'b T) -> &'a T { v }

fn bad<'a, T>(x: &'a T) -> &'static T {
    let f: fn(_, &'a T) -> &'static T = foo;
    //~^ ERROR lifetime may not live long enough
    f(UNIT, x)
}

fn main() {}