From e99d309c5695a2b5ad1ab44c06fd32ec506cebaa Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Wed, 19 Jul 2017 21:54:01 -0700 Subject: Use the macro structure spans instead of the invocation --- src/libsyntax/parse/parser.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index ae3edfcbf32..553cac80d82 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -150,7 +150,7 @@ fn maybe_append(mut lhs: Vec, rhs: Option>) lhs } -#[derive(Clone, Copy, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq)] enum PrevTokenKind { DocComment, Comma, @@ -6090,8 +6090,7 @@ impl<'a> Parser<'a> { let (delim, tts) = self.expect_delimited_token_tree()?; if delim != token::Brace { if !self.eat(&token::Semi) { - let prev_span = self.prev_span; - self.span_err(prev_span, + self.span_err(self.prev_span, "macros that expand to items must either \ be surrounded with braces or followed by \ a semicolon"); @@ -6108,8 +6107,7 @@ impl<'a> Parser<'a> { match visibility { Visibility::Inherited => {} _ => { - let prev_span = self.prev_span; - return Err(self.span_fatal(prev_span, "unmatched visibility `pub`")); + return Err(self.span_fatal(self.prev_span, "unmatched visibility `pub`")); } } -- cgit 1.4.1-3-g733a5