diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-02-27 13:32:21 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-27 13:32:21 +0100 |
| commit | f84a8cf28a5e914ae13f4d8d9c15468268e415d4 (patch) | |
| tree | fbf44e7b47ed63bee29136fe78e24d2c643d2c56 /src/libsyntax/ext | |
| parent | a46b00eeb5cb78288f04df0ab68b4192c92608c9 (diff) | |
| parent | 8300f51936149ec43eb063205e4d03c54a308f3c (diff) | |
| download | rust-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/build.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index 27b0cfb1630..2f88749ace8 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -1017,7 +1017,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> { ast::ItemKind::Fn(self.fn_decl(inputs, ast::FunctionRetTy::Ty(output)), ast::FnHeader { unsafety: ast::Unsafety::Normal, - asyncness: ast::IsAsync::NotAsync, + asyncness: dummy_spanned(ast::IsAsync::NotAsync), constness: dummy_spanned(ast::Constness::NotConst), abi: Abi::Rust, }, |
