about summary refs log tree commit diff
path: root/compiler/rustc_lint/src/passes.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-12-09 12:27:43 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2022-12-12 08:59:27 +1100
commit3c53781800e50b2abc72c5b1542400eff48a8126 (patch)
tree410b33806a1fd57ba771bd3103899a214b415386 /compiler/rustc_lint/src/passes.rs
parent2b05f841155c06b61fceb390c3cc3c2c974306a0 (diff)
downloadrust-3c53781800e50b2abc72c5b1542400eff48a8126.tar.gz
rust-3c53781800e50b2abc72c5b1542400eff48a8126.zip
Reinstate `{Early,Late}LintPassObjects`.
I removed these in #105291, and subsequently learned they are necessary
for performance.

This commit reinstates them with the new and more descriptive names
`RuntimeCombined{Early,Late}LintPass`, similar to the existing passes
like `BuiltinCombinedEarlyLintPass`. It also adds some comments,
particularly emphasising how we have ways to combine passes at both
compile-time and runtime. And it moves some comments around.
Diffstat (limited to 'compiler/rustc_lint/src/passes.rs')
-rw-r--r--compiler/rustc_lint/src/passes.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_lint/src/passes.rs b/compiler/rustc_lint/src/passes.rs
index 00922cef384..5558156a4b9 100644
--- a/compiler/rustc_lint/src/passes.rs
+++ b/compiler/rustc_lint/src/passes.rs
@@ -95,6 +95,11 @@ macro_rules! expand_combined_late_lint_pass_methods {
     )
 }
 
+/// Combines multiple lints passes into a single lint pass, at compile time,
+/// for maximum speed. Each `check_foo` method in `$methods` within this pass
+/// simply calls `check_foo` once per `$pass`. Compare with
+/// `LateLintPassObjects`, which is similar, but combines lint passes at
+/// runtime.
 #[macro_export]
 macro_rules! declare_combined_late_lint_pass {
     ([$v:vis $name:ident, [$($pass:ident: $constructor:expr,)*]], $methods:tt) => (
@@ -198,6 +203,11 @@ macro_rules! expand_combined_early_lint_pass_methods {
     )
 }
 
+/// Combines multiple lints passes into a single lint pass, at compile time,
+/// for maximum speed. Each `check_foo` method in `$methods` within this pass
+/// simply calls `check_foo` once per `$pass`. Compare with
+/// `EarlyLintPassObjects`, which is similar, but combines lint passes at
+/// runtime.
 #[macro_export]
 macro_rules! declare_combined_early_lint_pass {
     ([$v:vis $name:ident, [$($pass:ident: $constructor:expr,)*]], $methods:tt) => (