Make print_macro_backtrace non-recursive
This commit is contained in:
@@ -727,7 +727,9 @@ impl EmitterWriter {
|
||||
cm: &codemap::CodeMap,
|
||||
sp: Span)
|
||||
-> io::Result<()> {
|
||||
let cs = try!(cm.with_expn_info(sp.expn_id, |expn_info| -> io::Result<_> {
|
||||
let mut sp_opt = Some(sp);
|
||||
while let Some(sp) = sp_opt {
|
||||
sp_opt = try!(cm.with_expn_info(sp.expn_id, |expn_info| -> io::Result<_> {
|
||||
match expn_info {
|
||||
Some(ei) => {
|
||||
let ss = ei.callee.span.map_or(String::new(),
|
||||
@@ -750,7 +752,9 @@ impl EmitterWriter {
|
||||
None => Ok(None)
|
||||
}
|
||||
}));
|
||||
cs.map_or(Ok(()), |call_site| self.print_macro_backtrace(cm, call_site))
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user