2019-02-23 12:39:27 -06:00
|
|
|
// edition:2015
|
|
|
|
|
2020-11-30 15:11:29 -06:00
|
|
|
async fn foo() {} //~ ERROR `async fn` is not permitted in Rust 2015
|
2019-02-23 12:39:27 -06:00
|
|
|
|
2020-11-30 15:11:29 -06:00
|
|
|
fn baz() { async fn foo() {} } //~ ERROR `async fn` is not permitted in Rust 2015
|
2019-02-23 12:39:27 -06:00
|
|
|
|
2020-11-30 15:11:29 -06:00
|
|
|
async fn async_baz() { //~ ERROR `async fn` is not permitted in Rust 2015
|
|
|
|
async fn bar() {} //~ ERROR `async fn` is not permitted in Rust 2015
|
2019-02-23 12:39:27 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
struct Foo {}
|
|
|
|
|
|
|
|
impl Foo {
|
2020-11-30 15:11:29 -06:00
|
|
|
async fn foo() {} //~ ERROR `async fn` is not permitted in Rust 2015
|
2019-02-23 12:39:27 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
trait Bar {
|
2020-11-30 15:11:29 -06:00
|
|
|
async fn foo() {} //~ ERROR `async fn` is not permitted in Rust 2015
|
2020-02-11 01:19:21 -06:00
|
|
|
//~^ ERROR functions in traits cannot be declared `async`
|
2019-02-23 12:39:27 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
macro_rules! accept_item { ($x:item) => {} }
|
|
|
|
|
|
|
|
accept_item! {
|
2020-11-30 15:11:29 -06:00
|
|
|
async fn foo() {} //~ ERROR `async fn` is not permitted in Rust 2015
|
2019-02-23 12:39:27 -06:00
|
|
|
}
|
|
|
|
|
2019-06-29 14:38:26 -05:00
|
|
|
accept_item! {
|
|
|
|
impl Foo {
|
2020-11-30 15:11:29 -06:00
|
|
|
async fn bar() {} //~ ERROR `async fn` is not permitted in Rust 2015
|
2019-06-29 14:38:26 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-23 12:39:27 -06:00
|
|
|
let inside_closure = || {
|
2020-11-30 15:11:29 -06:00
|
|
|
async fn bar() {} //~ ERROR `async fn` is not permitted in Rust 2015
|
2019-02-23 12:39:27 -06:00
|
|
|
};
|
|
|
|
}
|