14 lines
274 B
Rust
14 lines
274 B
Rust
//@ 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() {}
|