IsAsync -> enum Async { Yes { span: Span, .. }, No }
use new span for better diagnostics.
This commit is contained in:
parent
e839b2ec84
commit
c30f068dc8
19 changed files with 96 additions and 108 deletions
|
|
@ -121,7 +121,7 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
|
|||
});
|
||||
iter_exprs(depth - 1, &mut |e| g(
|
||||
ExprKind::Closure(CaptureBy::Value,
|
||||
IsAsync::NotAsync,
|
||||
Async::No,
|
||||
Movability::Movable,
|
||||
decl.clone(),
|
||||
e,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ error[E0706]: trait fns cannot be declared `async`
|
|||
--> $DIR/async-trait-fn.rs:3:5
|
||||
|
|
||||
LL | async fn foo() {}
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
| -----^^^^^^^^^^^^
|
||||
| |
|
||||
| `async` because of this
|
||||
|
|
||||
= note: `async` trait functions are not currently supported
|
||||
= note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
|
||||
|
|
@ -11,7 +13,9 @@ error[E0706]: trait fns cannot be declared `async`
|
|||
--> $DIR/async-trait-fn.rs:4:5
|
||||
|
|
||||
LL | async fn bar(&self) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
| -----^^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| `async` because of this
|
||||
|
|
||||
= note: `async` trait functions are not currently supported
|
||||
= note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
|
||||
|
|
|
|||
|
|
@ -56,7 +56,9 @@ error[E0706]: trait fns cannot be declared `async`
|
|||
--> $DIR/edition-deny-async-fns-2015.rs:18:5
|
||||
|
|
||||
LL | async fn foo() {}
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
| -----^^^^^^^^^^^^
|
||||
| |
|
||||
| `async` because of this
|
||||
|
|
||||
= note: `async` trait functions are not currently supported
|
||||
= note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ error[E0706]: trait fns cannot be declared `async`
|
|||
--> $DIR/fn-header-semantic-fail.rs:17:9
|
||||
|
|
||||
LL | async fn ft1();
|
||||
| ^^^^^^^^^^^^^^^
|
||||
| -----^^^^^^^^^^
|
||||
| |
|
||||
| `async` because of this
|
||||
|
|
||||
= note: `async` trait functions are not currently supported
|
||||
= note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
|
||||
|
|
@ -17,7 +19,9 @@ error[E0706]: trait fns cannot be declared `async`
|
|||
--> $DIR/fn-header-semantic-fail.rs:21:21
|
||||
|
|
||||
LL | /* const */ async unsafe extern "C" fn ft5();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| `async` because of this
|
||||
|
|
||||
= note: `async` trait functions are not currently supported
|
||||
= note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
|
||||
|
|
@ -26,7 +30,9 @@ error[E0706]: trait fns cannot be declared `async`
|
|||
--> $DIR/fn-header-semantic-fail.rs:28:9
|
||||
|
|
||||
LL | async fn ft1() {}
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
| -----^^^^^^^^^^^^
|
||||
| |
|
||||
| `async` because of this
|
||||
|
|
||||
= note: `async` trait functions are not currently supported
|
||||
= note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
|
||||
|
|
@ -41,7 +47,9 @@ error[E0706]: trait fns cannot be declared `async`
|
|||
--> $DIR/fn-header-semantic-fail.rs:33:21
|
||||
|
|
||||
LL | /* const */ async unsafe extern "C" fn ft5() {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| `async` because of this
|
||||
|
|
||||
= note: `async` trait functions are not currently supported
|
||||
= note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue