fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

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