Skip to content

Commit

Permalink
Make coroutine-closures possible to be cloned
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Aug 9, 2024
1 parent d839703 commit 20e9c9e
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ LL | outlives::<'a>(call_once(c));
LL |
LL | let c = async move || { println!("{}", *x.0); };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move out of `x` occurs here
|
help: consider cloning the value if the performance cost is acceptable
|
LL | let c = async || { println!("{}", *x.0); }.clone();
| ++++++++

error[E0597]: `c` does not live long enough
--> $DIR/without-precise-captures-we-are-powerless.rs:33:20
Expand Down

0 comments on commit 20e9c9e

Please sign in to comment.