Skip to content

Commit 0db0622

Browse files
committed
Move async edition check to the current span
1 parent f744ac5 commit 0db0622

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2267,7 +2267,7 @@ impl<'a> Parser<'a> {
22672267
hi = path.span;
22682268
return Ok(self.mk_expr(lo.to(hi), ExprKind::Path(Some(qself), path), attrs));
22692269
}
2270-
if syntax_pos::hygiene::default_edition() >= Edition::Edition2018 &&
2270+
if self.span.edition() >= Edition::Edition2018 &&
22712271
self.check_keyword(keywords::Async)
22722272
{
22732273
if self.is_async_block() { // check for `async {` and `async move {`
@@ -3270,7 +3270,7 @@ impl<'a> Parser<'a> {
32703270
} else {
32713271
Movability::Movable
32723272
};
3273-
let asyncness = if syntax_pos::hygiene::default_edition() >= Edition::Edition2018
3273+
let asyncness = if self.span.edition() >= Edition::Edition2018
32743274
&& self.eat_keyword(keywords::Async)
32753275
{
32763276
IsAsync::Async(ast::DUMMY_NODE_ID)

0 commit comments

Comments
 (0)