summaryrefslogtreecommitdiffstats
path: root/third_party/rust/extend/tests/compile_pass/async_trait.rs
blob: 067bdc9bb788b51881bb2bc0e38c6966307a5578 (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
use extend::ext;
use async_trait::async_trait;

#[ext]
#[async_trait]
impl String {
    async fn foo() -> usize {
        1
    }
}

#[ext]
#[async_trait]
pub impl i32 {
    async fn bar() -> usize {
        1
    }
}

async fn foo() {
    let _: usize = String::foo().await;
    let _: usize = i32::bar().await;
}

fn main() {}