]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/issue-72766.rs
Rollup merge of #90420 - GuillaumeGomez:rustdoc-internals-feature, r=camelid
[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 }