]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/issue-72766.rs
Merge commit '370c397ec9169809e5ad270079712e0043514240' into sync_cg_clif-2022-03-20
[rust.git] / src / test / ui / suggestions / issue-72766.rs
1 // edition:2018
2 // incremental
3
4 pub struct SadGirl;
5
6 impl SadGirl {
7     pub async fn call(&self) -> Result<(), ()> {
8         Ok(())
9     }
10 }
11
12 async fn async_main() -> Result<(), ()> {
13     // should be `.call().await?`
14     SadGirl {}.call()?; //~ ERROR: the `?` operator can only be applied to values
15     Ok(())
16 }
17
18 fn main() {
19     let _ = async_main();
20 }