提交 0be755c2 编写于 作者: J Jonas Schievink

Print the file in which a macro was defined

上级 f3308b9c
......@@ -742,11 +742,20 @@ fn print_macro_backtrace(&mut self,
// Don't print recursive invocations
if ei.call_site != last_span {
last_span = ei.call_site;
try!(self.print_diagnostic(&cm.span_to_string(ei.call_site), Note,
&format!("in this expansion of {}{}{}",
pre,
ei.callee.name(),
post),
let mut diag_string = format!("in this expansion of {}{}{}",
pre,
ei.callee.name(),
post);
if let Some(def_site_span) = ei.callee.span {
diag_string.push_str(&format!(" (defined in {})",
cm.span_to_filename(def_site_span)));
}
try!(self.print_diagnostic(&cm.span_to_string(ei.call_site),
Note,
&diag_string,
None));
}
Ok(Some(ei.call_site))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册