rust/tests/ui/implied-bounds/implied-bounds-on-nested-references-plus-variance-early-bound.rs
Michael Goulet 67804c57e7 Adjust tests
2024-09-05 06:37:38 -04:00

14 lines
308 B
Rust

// Regression test for #129021.
static UNIT: &'static &'static () = &&();
fn foo<'a: 'a, 'b: '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() {}