From 27a2881402f703b28d81d3001edeb28e18f7f4dd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Esteban=20K=C3=BCber?= Date: Thu, 16 May 2019 14:30:39 -0700 Subject: [PATCH] Fix span for await macro call --- src/libsyntax/parse/parser.rs | 2 +- src/test/ui/feature-gate/await-macro.stderr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index bb0f9fa9502..c34c7f3f1bb 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2715,7 +2715,7 @@ fn parse_await_macro_or_alt( err })?; self.expect(&token::CloseDelim(token::Paren))?; - Ok((expr.span, ExprKind::Await(ast::AwaitOrigin::MacroLike, expr))) + Ok((self.prev_span, ExprKind::Await(ast::AwaitOrigin::MacroLike, expr))) } else { // Handle `await `. self.parse_incorrect_await_syntax(lo, await_sp) } diff --git a/src/test/ui/feature-gate/await-macro.stderr b/src/test/ui/feature-gate/await-macro.stderr index 57aab6800f7..699a7a8886e 100644 --- a/src/test/ui/feature-gate/await-macro.stderr +++ b/src/test/ui/feature-gate/await-macro.stderr @@ -2,7 +2,7 @@ error[E0658]: `await!()` macro syntax is unstable, and will soon be remove --> $DIR/await-macro.rs:9:5 | LL | await!(bar()); - | ^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | = note: for more information, see https://github.com/rust-lang/rust/issues/50547 = help: add #![feature(await_macro)] to the crate attributes to enable -- 2.44.0