rust/tests/ui/regions/region-bound-on-closure-outlives-call.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
955 B
Plaintext
Raw Normal View History

warning: function cannot return without recursing
2018-12-25 15:56:47 +00:00
--> $DIR/region-bound-on-closure-outlives-call.rs:1:1
|
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))
| ----------- 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-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))
| --- - ^ 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
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`.