rust/tests/ui/borrowck/cloning-in-async-block-121547.rs

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

12 lines
296 B
Rust
Raw Normal View History

//@ edition:2021
async fn clone_async_block(value: String) {
for _ in 0..10 {
async { //~ ERROR: use of moved value: `value` [E0382]
drop(value);
//~^ HELP: consider cloning the value if the performance cost is acceptable
}.await
}
}
fn main() {}