fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
919 B19 linesraw
1error[E0373]: async block may outlive the current function, but it borrows `room_ref`, which is owned by the current function
2  --> $DIR/issue-78938-async-block.rs:8:33
3   |
4LL |       let gameloop_handle = spawn(async {
5   |  _________________________________^
6LL | |         game_loop(Arc::clone(&room_ref))
7   | |                               -------- `room_ref` is borrowed here
8LL | |     });
9   | |_____^ may outlive borrowed value `room_ref`
10   |
11   = note: async blocks are not executed immediately and must either take a reference or ownership of outside variables they use
12help: to force the async block to take ownership of `room_ref` (and any other referenced variables), use the `move` keyword
13   |
14LL |     let gameloop_handle = spawn(async move {
15   |                                       ++++
16
17error: aborting due to previous error
18
19For more information about this error, try `rustc --explain E0373`.