rust/tests/ui/borrowck/alias-liveness/escaping-bounds-2.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
275 B
Rust
Raw Normal View History

trait Trait {
type Gat<'a: 'b, 'b: 'c, 'c>: 'c;
}
fn get_func<'a, T: Trait>(_: &'a str) -> fn(T::Gat<'a, '_, 'static>) {
loop {}
}
fn test<T: Trait>() {
let func = get_func::<T>(&String::new()); //~ ERROR temporary value dropped
drop(func);
}
fn main() {}