summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui-toml/large_futures/large_futures.fixed
blob: 7dea9fb95b4bb63d4e588335ab7c4a97c3ed15fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#![warn(clippy::large_futures)]

fn main() {}

pub async fn should_warn() {
    let x = [0u8; 1024];
    async {}.await;
    dbg!(x);
}

pub async fn should_not_warn() {
    let x = [0u8; 1020];
    async {}.await;
    dbg!(x);
}

pub async fn bar() {
    Box::pin(should_warn()).await;

    async {
        let x = [0u8; 1024];
        dbg!(x);
    }
    .await;

    should_not_warn().await;
}