diff options
| author | bors <bors@rust-lang.org> | 2017-07-22 13:30:19 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-07-22 13:30:19 +0000 |
| commit | 35f64996ad5639173040097a0fe718e25d0dc29d (patch) | |
| tree | 007a6e8ff004824b69598715440cb0206b83cfd8 /src/libsyntax/parse/parser.rs | |
| parent | e49a9483dedb3b9405dd04ac04d49a1196068347 (diff) | |
| parent | 6772661f37d6a6f88b95808fe957b8c6c15371f9 (diff) | |
| download | rust-35f64996ad5639173040097a0fe718e25d0dc29d.tar.gz rust-35f64996ad5639173040097a0fe718e25d0dc29d.zip | |
Auto merge of #43352 - estebank:macro-span-replacement, r=petrochenkov
Use the macro structure spans instead of the invocation Fix #42104, CC #2887.
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 8 |
1 files changed, 3 insertions, 5 deletions
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<Attribute>, rhs: Option<Vec<Attribute>>) 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`")); } } |
