Skip to content

Commit fc4da00

Browse files
Make coroutine-closures possible to be cloned
1 parent 57243ed commit fc4da00

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.stderr

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ LL | outlives::<'a>(call_once(c));
5656
LL |
5757
LL | let c = async move || { println!("{}", *x.0); };
5858
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move out of `x` occurs here
59+
|
60+
help: consider cloning the value if the performance cost is acceptable
61+
|
62+
LL | let c = async || { println!("{}", *x.0); }.clone();
63+
| ++++++++
5964

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

0 commit comments

Comments
 (0)