summaryrefslogtreecommitdiffstats
path: root/third_party/rust/tokio/tests/macros_pin.rs
blob: 70c95a1c8235563b51e91d5acfda24bdcf7b541f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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;
}