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

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Commit 37bf2d2

Delay the construction of early lint diag structs

Fixes a slew of perf regressions.

File tree

2 files changed

lines changed

2 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -539,7 +539,9 @@ impl EarlyContext<'_> {
539 539 span: MultiSpan,
540 540 diagnostic: BuiltinLintDiag,
541 541 ) {
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 +});
543 545 }
544 546 }
545 547