diff options
Diffstat (limited to 'third_party/rust/tokio/tests/macros_pin.rs')
-rw-r--r-- | third_party/rust/tokio/tests/macros_pin.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/third_party/rust/tokio/tests/macros_pin.rs b/third_party/rust/tokio/tests/macros_pin.rs new file mode 100644 index 0000000000..70c95a1c82 --- /dev/null +++ b/third_party/rust/tokio/tests/macros_pin.rs @@ -0,0 +1,21 @@ +#![cfg(feature = "macros")] + +#[cfg(target_arch = "wasm32")] +use wasm_bindgen_test::wasm_bindgen_test as maybe_tokio_test; + +#[cfg(not(target_arch = "wasm32"))] +use tokio::test as maybe_tokio_test; + +async fn one() {} +async fn two() {} + +#[maybe_tokio_test] +async fn multi_pin() { + tokio::pin! { + let f1 = one(); + let f2 = two(); + } + + (&mut f1).await; + (&mut f2).await; +} |