summaryrefslogtreecommitdiffstats
path: root/tests/ui/async-await/future-sizes/future-as-arg.rs
blob: 93c69b05254dc393810ea30ac1d13e430bca82f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// edition: 2021
// run-pass

async fn test(_arg: [u8; 16]) {}

async fn use_future(fut: impl std::future::Future<Output = ()>) {
    fut.await
}

fn main() {
    let actual = std::mem::size_of_val(
        &use_future(use_future(use_future(use_future(use_future(test([0; 16])))))));
    // Not using an exact number in case it slightly changes over different commits
    let expected = 550;
    assert!(actual > expected, "expected: >{expected}, actual: {actual}");
}