2021-11-16 14:07:23 -06:00
|
|
|
// edition:2018
|
|
|
|
|
|
|
|
async fn foo () { }
|
2021-12-02 17:41:45 -06:00
|
|
|
fn bar() -> impl std::future::Future { async {} }
|
|
|
|
fn boo() {}
|
2021-11-16 14:07:23 -06:00
|
|
|
|
|
|
|
async fn baz() -> std::io::Result<()> {
|
|
|
|
foo().await;
|
|
|
|
boo().await; //~ ERROR `()` is not a future
|
|
|
|
bar().await;
|
|
|
|
std::io::Result::Ok(())
|
|
|
|
}
|
|
|
|
|
2023-04-27 12:40:55 -05:00
|
|
|
macro_rules! e {
|
|
|
|
() => {
|
|
|
|
()
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! f {
|
|
|
|
($expr:expr) => {
|
|
|
|
$expr.await
|
|
|
|
//~^ ERROR `()` is not a future
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn with_macros() {
|
|
|
|
e!().await;
|
|
|
|
//~^ ERROR `()` is not a future
|
|
|
|
|
|
|
|
f!(());
|
|
|
|
}
|
|
|
|
|
2023-10-21 06:16:09 -05:00
|
|
|
// Regression test for issue #117014.
|
|
|
|
async fn desugaring_span_ctxt() {
|
|
|
|
for x in [] {}.await //~ ERROR `()` is not a future
|
|
|
|
}
|
|
|
|
|
2021-11-16 17:04:15 -06:00
|
|
|
fn main() {}
|