2018-09-11 21:35:08 -04:00
|
|
|
warning: function cannot return without recursing
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/region-bound-on-closure-outlives-call.rs:1:1
|
2018-09-11 21:35:08 -04:00
|
|
|
|
|
|
|
|
LL | fn call_rec<F>(mut f: F) -> usize where F: FnMut(usize) -> usize {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
|
2019-03-09 15:03:44 +03:00
|
|
|
LL |
|
|
|
|
LL | (|x| f(x))(call_rec(f))
|
2018-09-11 21:35:08 -04:00
|
|
|
| ----------- recursive call site
|
|
|
|
|
|
2019-07-16 22:17:38 +02:00
|
|
|
= note: `#[warn(unconditional_recursion)]` on by default
|
2018-09-11 21:35:08 -04:00
|
|
|
= help: a `loop` may express intention better if this is on purpose
|
|
|
|
|
2018-08-08 14:28:26 +02:00
|
|
|
error[E0505]: cannot move out of `f` because it is borrowed
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/region-bound-on-closure-outlives-call.rs:3:25
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | (|x| f(x))(call_rec(f))
|
2019-04-22 08:40:08 +01:00
|
|
|
| --- - ^ move out of `f` occurs here
|
|
|
|
| | |
|
|
|
|
| | borrow occurs due to use in closure
|
2018-08-08 14:28:26 +02:00
|
|
|
| borrow of `f` occurs here
|
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0505`.
|