24 lines
1003 B
Plaintext
24 lines
1003 B
Plaintext
warning: function cannot return without recursing
|
|
--> $DIR/region-bound-on-closure-outlives-call.rs:11:1
|
|
|
|
|
LL | fn call_rec<F>(mut f: F) -> usize where F: FnMut(usize) -> usize {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
|
|
LL | //~^ WARN function cannot return without recursing
|
|
LL | (|x| f(x))(call_rec(f)) //~ ERROR cannot move out of `f`
|
|
| ----------- recursive call site
|
|
|
|
|
= note: #[warn(unconditional_recursion)] on by default
|
|
= help: a `loop` may express intention better if this is on purpose
|
|
|
|
error[E0505]: cannot move out of `f` because it is borrowed
|
|
--> $DIR/region-bound-on-closure-outlives-call.rs:13:25
|
|
|
|
|
LL | (|x| f(x))(call_rec(f)) //~ ERROR cannot move out of `f`
|
|
| --- ^ move out of `f` occurs here
|
|
| |
|
|
| borrow of `f` occurs here
|
|
|
|
error: aborting due to previous error
|
|
|
|
For more information about this error, try `rustc --explain E0505`.
|