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