diff options
Diffstat (limited to 'tests/ui/async-await/no-move-across-await-tuple.rs')
-rw-r--r-- | tests/ui/async-await/no-move-across-await-tuple.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/async-await/no-move-across-await-tuple.rs b/tests/ui/async-await/no-move-across-await-tuple.rs new file mode 100644 index 000000000..a65633269 --- /dev/null +++ b/tests/ui/async-await/no-move-across-await-tuple.rs @@ -0,0 +1,12 @@ +// edition:2018 +// compile-flags: --crate-type lib + +async fn no_move_across_await_tuple() -> Vec<usize> { + let x = (vec![3], vec![4, 4]); + drop(x.1); + nothing().await; + x.1 + //~^ ERROR use of moved value: `x.1` +} + +async fn nothing() {} |