Skip to content

Commit

Permalink
Avoid emitting full macro body into JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed Feb 24, 2022
1 parent 3d127e2 commit 34319ff
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions compiler/rustc_errors/src/json.rs
Expand Up @@ -454,8 +454,14 @@ impl DiagnosticSpan {
let end = je.sm.lookup_char_pos(span.hi());
let backtrace_step = backtrace.next().map(|bt| {
let call_site = Self::from_span_full(bt.call_site, false, None, None, backtrace, je);
let def_site_span =
Self::from_span_full(bt.def_site, false, None, None, [].into_iter(), je);
let def_site_span = Self::from_span_full(
je.sm.guess_head_span(bt.def_site),
false,
None,
None,
[].into_iter(),
je,
);
Box::new(DiagnosticSpanMacroExpansion {
span: call_site,
macro_decl_name: bt.kind.descr(),
Expand Down

0 comments on commit 34319ff

Please sign in to comment.