Skip to content

Commit fab3295

Browse files
committed
Suppress the macro backtrace for fileline_note and fileline_help.
1 parent 5a8f102 commit fab3295

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/libsyntax/codemap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ impl CodeMap {
871871
F: FnOnce(Option<&ExpnInfo>) -> T,
872872
{
873873
match id {
874-
NO_EXPANSION => f(None),
874+
NO_EXPANSION | COMMAND_LINE_EXPN => f(None),
875875
ExpnId(i) => f(Some(&(*self.expansions.borrow())[i as usize]))
876876
}
877877
}

src/libsyntax/diagnostic.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -465,22 +465,21 @@ fn emit(dst: &mut EmitterWriter, cm: &codemap::CodeMap, rsp: RenderSpan,
465465
match rsp {
466466
FullSpan(_) => {
467467
try!(highlight_lines(dst, cm, sp, lvl, cm.span_to_lines(sp)));
468+
try!(print_macro_backtrace(dst, cm, sp));
468469
}
469470
EndSpan(_) => {
470471
try!(end_highlight_lines(dst, cm, sp, lvl, cm.span_to_lines(sp)));
472+
try!(print_macro_backtrace(dst, cm, sp));
471473
}
472474
Suggestion(_, ref suggestion) => {
473475
try!(highlight_suggestion(dst, cm, sp, suggestion));
476+
try!(print_macro_backtrace(dst, cm, sp));
474477
}
475478
FileLine(..) => {
476479
// no source text in this case!
477480
}
478481
}
479482

480-
if sp != COMMAND_LINE_SP {
481-
try!(print_macro_backtrace(dst, cm, sp));
482-
}
483-
484483
match code {
485484
Some(code) =>
486485
match dst.registry.as_ref().and_then(|registry| registry.find_description(code)) {

0 commit comments

Comments
 (0)