blob: c54be7f5dff0d9497668de34e60c7a8d062cf45c (
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();
}
|