about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorTaylor Cramer <cramertj@google.com>2018-06-19 13:58:32 -0700
committerTaylor Cramer <cramertj@google.com>2018-06-21 22:38:05 -0700
commit0db0622de4756611464fe76e438218e2fa6759d8 (patch)
treec0045e97c9800fd8d741e05476c86f7a1aee5480 /src/libsyntax/parse
parentf744ac553872afaf8c44f842dc0f247a623841b0 (diff)
downloadrust-0db0622de4756611464fe76e438218e2fa6759d8.tar.gz
rust-0db0622de4756611464fe76e438218e2fa6759d8.zip
Move async edition check to the current span
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index e59efcd6857..0be149d7a03 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -2267,7 +2267,7 @@ impl<'a> Parser<'a> {
                     hi = path.span;
                     return Ok(self.mk_expr(lo.to(hi), ExprKind::Path(Some(qself), path), attrs));
                 }
-                if syntax_pos::hygiene::default_edition() >= Edition::Edition2018 &&
+                if self.span.edition() >= Edition::Edition2018 &&
                     self.check_keyword(keywords::Async)
                 {
                     if self.is_async_block() { // check for `async {` and `async move {`
@@ -3270,7 +3270,7 @@ impl<'a> Parser<'a> {
         } else {
             Movability::Movable
         };
-        let asyncness = if syntax_pos::hygiene::default_edition() >= Edition::Edition2018
+        let asyncness = if self.span.edition() >= Edition::Edition2018
             && self.eat_keyword(keywords::Async)
         {
             IsAsync::Async(ast::DUMMY_NODE_ID)