]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/issue-72766.rs
Rollup merge of #106888 - GuillaumeGomez:tidy-gui-test, r=notriddle
[rust.git] / tests / 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 }