rust/tests/ui/impl-trait/issue-87450.rs

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

17 lines
367 B
Rust
Raw Normal View History

2021-07-30 13:32:22 -05:00
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() {
}