1 warning: function cannot return without recursing
2 --> $DIR/region-bound-on-closure-outlives-call.rs:1:1
4 LL | fn call_rec<F>(mut f: F) -> usize where F: FnMut(usize) -> usize {
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
6 LL | //~^ WARN function cannot return without recursing
7 LL | (|x| f(x))(call_rec(f)) //~ ERROR cannot move out of `f`
8 | ----------- recursive call site
10 = note: #[warn(unconditional_recursion)] on by default
11 = help: a `loop` may express intention better if this is on purpose
13 error[E0505]: cannot move out of `f` because it is borrowed
14 --> $DIR/region-bound-on-closure-outlives-call.rs:3:25
16 LL | (|x| f(x))(call_rec(f)) //~ ERROR cannot move out of `f`
17 | ---------- ^ move out of `f` occurs here
19 | || borrow occurs due to use in closure
20 | |borrow of `f` occurs here
21 | borrow later used by call
23 error: aborting due to previous error
25 For more information about this error, try `rustc --explain E0505`.