Rollup merge of #91575 - compiler-errors:issue-91556, r=cjgillot
Fix ICE on format string of macro with secondary-label This generalizes the fix #86104 to also correctly skip `Span::from_inner` for the `secondary_label` of a format macro parsing error as well. We can alternatively skip the `span_label` diagnostic call for the secondary label as well, since that label probably only makes sense when the _proper_ span is computed. Fixes #91556
This commit is contained in:
commit
6cfe9af6a0
3 changed files with 22 additions and 2 deletions
|
@ -995,8 +995,9 @@ pub fn expand_preparsed_format_args(
|
|||
e.note(¬e);
|
||||
}
|
||||
if let Some((label, span)) = err.secondary_label {
|
||||
let sp = fmt_span.from_inner(span);
|
||||
e.span_label(sp, label);
|
||||
if efmt_kind_is_lit {
|
||||
e.span_label(fmt_span.from_inner(span), label);
|
||||
}
|
||||
}
|
||||
e.emit();
|
||||
return DummyResult::raw_expr(sp, true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue