1
Fork 0

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, F: FnOnce(Option<&ExpnInfo>) -> T,
{ {
match id { match id {
NO_EXPANSION => f(None), NO_EXPANSION | COMMAND_LINE_EXPN => f(None),
ExpnId(i) => f(Some(&(*self.expansions.borrow())[i as usize])) 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 { match rsp {
FullSpan(_) => { FullSpan(_) => {
try!(highlight_lines(dst, cm, sp, lvl, cm.span_to_lines(sp))); try!(highlight_lines(dst, cm, sp, lvl, cm.span_to_lines(sp)));
try!(print_macro_backtrace(dst, cm, sp));
} }
EndSpan(_) => { EndSpan(_) => {
try!(end_highlight_lines(dst, cm, sp, lvl, cm.span_to_lines(sp))); try!(end_highlight_lines(dst, cm, sp, lvl, cm.span_to_lines(sp)));
try!(print_macro_backtrace(dst, cm, sp));
} }
Suggestion(_, ref suggestion) => { Suggestion(_, ref suggestion) => {
try!(highlight_suggestion(dst, cm, sp, suggestion)); try!(highlight_suggestion(dst, cm, sp, suggestion));
try!(print_macro_backtrace(dst, cm, sp));
} }
FileLine(..) => { FileLine(..) => {
// no source text in this case! // no source text in this case!
} }
} }
if sp != COMMAND_LINE_SP {
try!(print_macro_backtrace(dst, cm, sp));
}
match code { match code {
Some(code) => Some(code) =>
match dst.registry.as_ref().and_then(|registry| registry.find_description(code)) { match dst.registry.as_ref().and_then(|registry| registry.find_description(code)) {