about summary refs log tree commit diff
path: root/tests/ui/async-await/async-closures/await-inference-guidance.rs
blob: 1ddc1f8d1c5d3adaf0a883d09bef3125f1480b20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//@ aux-build:block-on.rs
//@ edition:2021
//@ run-pass

#![feature(async_closure)]

extern crate block_on;

fn main() {
    block_on::block_on(async {
        let x = async |x: &str| -> String { x.to_owned() };
        let mut s = x("hello, world").await;
        s.truncate(4);
        println!("{s}");
    });
}