]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/no-move-across-await-struct.rs
Rollup merge of #103570 - lukas-code:stabilize-ilog, r=scottmcm
[rust.git] / src / test / ui / async-await / no-move-across-await-struct.rs
1 // edition:2018
2 // compile-flags: --crate-type lib
3
4 async fn no_move_across_await_struct() -> Vec<usize> {
5     let s = Small { x: vec![31], y: vec![19, 1441] };
6     needs_vec(s.x).await;
7     s.x
8     //~^ ERROR use of moved value: `s.x`
9 }
10
11 struct Small {
12     x: Vec<usize>,
13     y: Vec<usize>,
14 }
15
16 async fn needs_vec(_vec: Vec<usize>) {}