Skip to content

Commit 0a0c08a

Browse files
---
yaml --- r: 234230 b: refs/heads/beta c: f3308b9 h: refs/heads/master v: v3
1 parent f48d7cf commit 0a0c08a

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 31fa44b18e6e8bd42630d6495823ade6a5adaeba
26+
refs/heads/beta: f3308b9c9d9b0cd5ace3d1fa4d3b0194a78187d0
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/libsyntax/diagnostic.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,9 @@ impl EmitterWriter {
727727
cm: &codemap::CodeMap,
728728
sp: Span)
729729
-> io::Result<()> {
730+
let mut last_span = codemap::DUMMY_SP;
730731
let mut sp_opt = Some(sp);
732+
731733
while let Some(sp) = sp_opt {
732734
sp_opt = try!(cm.with_expn_info(sp.expn_id, |expn_info| -> io::Result<_> {
733735
match expn_info {
@@ -737,12 +739,16 @@ impl EmitterWriter {
737739
codemap::MacroBang(..) => ("", "!"),
738740
codemap::CompilerExpansion(..) => ("", ""),
739741
};
740-
try!(self.print_diagnostic(&cm.span_to_string(ei.call_site), Note,
741-
&format!("in this expansion of {}{}{}",
742-
pre,
743-
ei.callee.name(),
744-
post),
745-
None));
742+
// Don't print recursive invocations
743+
if ei.call_site != last_span {
744+
last_span = ei.call_site;
745+
try!(self.print_diagnostic(&cm.span_to_string(ei.call_site), Note,
746+
&format!("in this expansion of {}{}{}",
747+
pre,
748+
ei.callee.name(),
749+
post),
750+
None));
751+
}
746752
Ok(Some(ei.call_site))
747753
}
748754
None => Ok(None)

0 commit comments

Comments
 (0)