1
Fork 0

Move help link to error index

This commit is contained in:
1000teslas 2021-01-13 23:37:49 +11:00
parent 3ee3071344
commit 7f41465f6d
2 changed files with 23 additions and 3 deletions

View file

@ -50,3 +50,25 @@ fn foo() -> Box<Fn(u32) -> u32> {
Now that the closure has its own copy of the data, there's no need to worry
about safety.
This error may also be encountered while using `async` blocks:
```compile_fail,E0373
use std::sync::Arc;
use tokio::runtime::Runtime; // 0.3.1
async fn f() {
let room_ref = Arc::new(Vec::new());
let gameloop_handle = Runtime::new().unwrap().spawn(async {
game_loop(Arc::clone(&room_ref))
});
gameloop_handle.await;
}
fn game_loop(v: Arc<Vec<usize>>) {}
```
Similarly to closures, `async` blocks are not executed immediately and may
capture closed-over data by reference. For more information, see
https://rust-lang.github.io/async-book/03_async_await/01_chapter.html.