]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/region-bound-on-closure-outlives-call.stderr
Rollup merge of #97317 - GuillaumeGomez:gui-settings-text-click, r=jsha
[rust.git] / src / test / ui / regions / region-bound-on-closure-outlives-call.stderr
1 warning: function cannot return without recursing
2   --> $DIR/region-bound-on-closure-outlives-call.rs:1:1
3    |
4 LL | fn call_rec<F>(mut f: F) -> usize where F: FnMut(usize) -> usize {
5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
6 LL |
7 LL |     (|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
13 error[E0505]: cannot move out of `f` because it is borrowed
14   --> $DIR/region-bound-on-closure-outlives-call.rs:3:25
15    |
16 LL |     (|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
22 error: aborting due to previous error; 1 warning emitted
23
24 For more information about this error, try `rustc --explain E0505`.