2018-09-12 01:35:08 +00:00
|
|
|
warning: function cannot return without recursing
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/region-bound-on-closure-outlives-call.rs:1:1
|
2018-09-12 01:35:08 +00:00
|
|
|
|
|
|
|
|
LL | fn call_rec<F>(mut f: F) -> usize where F: FnMut(usize) -> usize {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
|
2019-03-09 12:03:44 +00:00
|
|
|
LL |
|
|
|
|
LL | (|x| f(x))(call_rec(f))
|
2018-09-12 01:35:08 +00:00
|
|
|
| ----------- 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
|
2018-09-12 01:35:08 +00:00
|
|
|
|
2018-08-08 12:28:26 +00:00
|
|
|
error[E0505]: cannot move out of `f` because it is borrowed
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/region-bound-on-closure-outlives-call.rs:3:25
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | (|x| f(x))(call_rec(f))
|
2019-04-22 07:40:08 +00:00
|
|
|
| --- - ^ move out of `f` occurs here
|
|
|
|
| | |
|
|
|
|
| | borrow occurs due to use in closure
|
2018-08-08 12:28:26 +00:00
|
|
|
| borrow of `f` occurs here
|
|
|
|
|
2020-03-11 15:30:09 +00:00
|
|
|
error: aborting due to previous error; 1 warning emitted
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0505`.
|