about summary refs log tree commit diff
path: root/tests/ui/implied-bounds/implied-bounds-on-nested-references-plus-variance-2.rs
blob: ca8b8b7e4d92b1567d6035e9abeabba2046c10f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//@ check-pass
//@ known-bug: #25860

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;
    f(UNIT, x, &())
}

fn main() {}