rust/tests/ui/impl-trait/issue-87450.rs
2023-01-11 09:32:08 +00:00

17 lines
367 B
Rust

fn bar() -> impl Fn() {
wrap(wrap(wrap(wrap(foo()))))
}
fn foo() -> impl Fn() {
//~^ WARNING 5:1: 5:22: function cannot return without recursing [unconditional_recursion]
//~| ERROR 5:13: 5:22: cannot resolve opaque type [E0720]
wrap(wrap(wrap(wrap(wrap(wrap(wrap(foo())))))))
}
fn wrap(f: impl Fn()) -> impl Fn() {
move || f()
}
fn main() {
}