Rollup merge of #54967 - holmgr:master, r=estebank

Remove incorrect span for second label inner macro invocation

A fix for issue #54841
This commit is contained in:
kennytm
2018-10-12 22:04:16 +08:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

@@ -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");