Suppress the macro backtrace for fileline_note and fileline_help.

This commit is contained in:
Ryan Prichard 2015-04-05 18:07:11 -07:00
parent 5a8f102bf6
commit fab3295cba
2 changed files with 4 additions and 5 deletions

View File

@ -871,7 +871,7 @@ impl CodeMap {
F: FnOnce(Option<&ExpnInfo>) -> T,
{
match id {
NO_EXPANSION => f(None),
NO_EXPANSION | COMMAND_LINE_EXPN => f(None),
ExpnId(i) => f(Some(&(*self.expansions.borrow())[i as usize]))
}
}

View File

@ -465,22 +465,21 @@ fn emit(dst: &mut EmitterWriter, cm: &codemap::CodeMap, rsp: RenderSpan,
match rsp {
FullSpan(_) => {
try!(highlight_lines(dst, cm, sp, lvl, cm.span_to_lines(sp)));
try!(print_macro_backtrace(dst, cm, sp));
}
EndSpan(_) => {
try!(end_highlight_lines(dst, cm, sp, lvl, cm.span_to_lines(sp)));
try!(print_macro_backtrace(dst, cm, sp));
}
Suggestion(_, ref suggestion) => {
try!(highlight_suggestion(dst, cm, sp, suggestion));
try!(print_macro_backtrace(dst, cm, sp));
}
FileLine(..) => {
// no source text in this case!
}
}
if sp != COMMAND_LINE_SP {
try!(print_macro_backtrace(dst, cm, sp));
}
match code {
Some(code) =>
match dst.registry.as_ref().and_then(|registry| registry.find_description(code)) {