about summary refs log tree commit diff
path: root/src/libsyntax_ext
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-02-27 13:32:21 +0100
committerGitHub <noreply@github.com>2019-02-27 13:32:21 +0100
commitf84a8cf28a5e914ae13f4d8d9c15468268e415d4 (patch)
treefbf44e7b47ed63bee29136fe78e24d2c643d2c56 /src/libsyntax_ext
parenta46b00eeb5cb78288f04df0ab68b4192c92608c9 (diff)
parent8300f51936149ec43eb063205e4d03c54a308f3c (diff)
downloadrust-f84a8cf28a5e914ae13f4d8d9c15468268e415d4.tar.gz
rust-f84a8cf28a5e914ae13f4d8d9c15468268e415d4.zip
Rollup merge of #58678 - doctorn:refuse-async-fn-2015-edition, r=varkor
Deny `async fn` in 2015 edition

This commit prevents code using `async fn` from being compiled in Rust 2015 edition.

Compiling code of the form:

```rust
async fn foo() {}
```

Will now result in the error:

```
error[E0670]: `async fn` is not permitted in the 2015 edition
 --> async.rs:1:1
  |
1 | async fn foo() {}
  | ^^^^^

error: aborting due to error

For more information about an error, try `rustc --explain E0670`.
```

This resolves #58652 and also resolves #53714.

r? @varkor
Diffstat (limited to 'src/libsyntax_ext')
-rw-r--r--src/libsyntax_ext/test.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax_ext/test.rs b/src/libsyntax_ext/test.rs
index 37186246548..f4b625f8ea2 100644
--- a/src/libsyntax_ext/test.rs
+++ b/src/libsyntax_ext/test.rs
@@ -257,7 +257,7 @@ fn has_test_signature(cx: &ExtCtxt<'_>, i: &ast::Item) -> bool {
             );
             return false
         }
-        if header.asyncness.is_async() {
+        if header.asyncness.node.is_async() {
             sd.span_err(
                 i.span,
                 "async functions cannot be used for tests"