about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-10-12 15:00:24 +0000
committerbors <bors@rust-lang.org>2018-10-12 15:00:24 +0000
commit945372d26818f93d6f5cded7b751749e280b67bf (patch)
tree434e524cba2dee5a76b2aca15ef28c1f3229ff8e /src/libsyntax/parse
parente9e27e6a6258b3adf00a5dd35d2676656224880d (diff)
parentd64c77a671390a7ce9072e550ffa57837892a4fe (diff)
downloadrust-945372d26818f93d6f5cded7b751749e280b67bf.tar.gz
rust-945372d26818f93d6f5cded7b751749e280b67bf.zip
Auto merge of #55012 - kennytm:rollup, r=kennytm
Rollup of 16 pull requests

Successful merges:

 - #54755 (Documents reference equality by address (#54197))
 - #54811 (During rustc bootstrap, make default for `optimize` independent of `debug`)
 - #54825 (NLL says "borrowed content" instead of more precise "dereference of raw pointer")
 - #54860 (Add doc comments about safest way to initialize a vector of zeros)
 - #54869 (Fix mobile docs)
 - #54891 (Fix tracking issue for Once::is_completed)
 - #54913 (doc fix: it's auto traits that make for automatic implementations)
 - #54920 (Fix handling of #[must_use] on unit and uninhabited types)
 - #54932 (A handful of random string-related improvements)
 - #54936 (impl Eq+Hash for TyLayout)
 - #54950 (std: Synchronize global allocator on wasm32)
 - #54956 ("(using ..." doesn't have the matching ")")
 - #54958 (add a macro for static (compile-time) assertions)
 - #54967 (Remove incorrect span for second label inner macro invocation)
 - #54983 (Fix slice's benchmarks)
 - #54989 (Fix spelling in the documentation to htmldocck.py)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 6c375799c38..b5896f37c00 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -772,6 +772,11 @@ impl<'a> Parser<'a> {
                     //   |                   expected one of 8 possible tokens here
                     err.span_label(self.span, label_exp);
                 }
+                _ if self.prev_span == syntax_pos::DUMMY_SP => {
+                    // Account for macro context where the previous span might not be
+                    // available to avoid incorrect output (#54841).
+                    err.span_label(self.span, "unexpected token");
+                }
                 _ => {
                     err.span_label(sp, label_exp);
                     err.span_label(self.span, "unexpected token");