Delay the construction of early lint diag structs · rust-lang/rust@37bf2d2

Original file line numberDiff line numberDiff line change

@@ -539,7 +539,9 @@ impl EarlyContext<'_> {

539539

span: MultiSpan,

540540

diagnostic: BuiltinLintDiag,

541541

) {

542-

diagnostics::emit_buffered_lint(self, lint, span, diagnostic)

542+

self.opt_span_lint(lint, Some(span), |diag| {

543+

diagnostics::decorate_lint(self.sess(), diagnostic, diag);

544+

});

543545

}

544546

}

545547