Skip to content

Commit

Permalink
Delay the construction of early lint diag structs
Browse files Browse the repository at this point in the history
Fixes a slew of perf regressions.
  • Loading branch information
fmease committed May 23, 2024
1 parent 9f67c50 commit 37bf2d2
Show file tree
Hide file tree
Showing 2 changed files with 156 additions and 231 deletions.
4 changes: 3 additions & 1 deletion compiler/rustc_lint/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,9 @@ impl EarlyContext<'_> {
span: MultiSpan,
diagnostic: BuiltinLintDiag,
) {
diagnostics::emit_buffered_lint(self, lint, span, diagnostic)
self.opt_span_lint(lint, Some(span), |diag| {
diagnostics::decorate_lint(self.sess(), diagnostic, diag);
});
}
}

Expand Down
Loading

0 comments on commit 37bf2d2

Please sign in to comment.