about summary refs log tree commit diff
path: root/tests/ui/suggestions/issue-72766.rs
blob: b9b93f22d9cfefde49b45c3d6716212e6496fa02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//@ edition:2018
//@ incremental

pub struct SadGirl;

impl SadGirl {
    pub async fn call(&self) -> Result<(), ()> {
        Ok(())
    }
}

async fn async_main() -> Result<(), ()> {
    // should be `.call().await?`
    SadGirl {}.call()?; //~ ERROR: the `?` operator can only be applied to values
    Ok(())
}

fn main() {
    let _ = async_main();
}