From: Esteban Küber Date: Thu, 16 May 2019 21:30:39 +0000 (-0700) Subject: Fix span for await macro call X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=27a2881402f703b28d81d3001edeb28e18f7f4dd;p=rust.git Fix span for await macro call --- 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