2021-07-30 18:32:22 +00:00
|
|
|
warning: function cannot return without recursing
|
|
|
|
--> $DIR/issue-87450.rs:5:1
|
|
|
|
|
|
|
|
|
LL | fn foo() -> impl Fn() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
|
|
|
|
...
|
|
|
|
LL | wrap(wrap(wrap(wrap(wrap(wrap(wrap(foo())))))))
|
|
|
|
| ----- recursive call site
|
|
|
|
|
|
|
|
|
= help: a `loop` may express intention better if this is on purpose
|
2022-09-18 15:55:36 +00:00
|
|
|
= note: `#[warn(unconditional_recursion)]` on by default
|
2021-07-30 18:32:22 +00:00
|
|
|
|
|
|
|
error[E0720]: cannot resolve opaque type
|
|
|
|
--> $DIR/issue-87450.rs:5:13
|
|
|
|
|
|
|
|
|
LL | fn foo() -> impl Fn() {
|
|
|
|
| ^^^^^^^^^ recursive opaque type
|
|
|
|
...
|
|
|
|
LL | wrap(wrap(wrap(wrap(wrap(wrap(wrap(foo())))))))
|
2021-11-23 18:34:01 +00:00
|
|
|
| ----------------------------------------------- returning here with type `impl Fn()`
|
2021-07-30 18:32:22 +00:00
|
|
|
...
|
|
|
|
LL | fn wrap(f: impl Fn()) -> impl Fn() {
|
2021-11-23 18:34:01 +00:00
|
|
|
| --------- returning this opaque type `impl Fn()`
|
2021-07-30 18:32:22 +00:00
|
|
|
|
2023-11-21 15:44:16 +00:00
|
|
|
error: aborting due to 1 previous error; 1 warning emitted
|
2021-07-30 18:32:22 +00:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0720`.
|