rust/tests/ui/suggestions/issue-72766.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
353 B
Rust
Raw Normal View History

2020-05-30 04:48:54 -05:00
// edition:2018
// incremental
2020-05-30 04:48:54 -05:00
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();
}