Skip to content

Commit ac1e69c

Browse files
committed
Add some useful comments.
1 parent 0c84473 commit ac1e69c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

compiler/rustc_lint/src/lib.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ fn lint_mod(tcx: TyCtxt<'_>, module_def_id: LocalDefId) {
127127
late::late_lint_mod(tcx, module_def_id, BuiltinCombinedModuleLateLintPass::new());
128128
}
129129

130+
// See the comment on `BuiltinCombinedEarlyLintPass`, which is similar.
130131
early_lint_methods!(
131132
declare_combined_early_lint_pass,
132133
[
@@ -137,6 +138,9 @@ early_lint_methods!(
137138
]
138139
);
139140

141+
// Declare `BuiltinCombinedEarlyLintPass`, a lint pass that combines multiple
142+
// lint passes into a single pass for maximum speed. Each `check_foo` method
143+
// within this pass simply calls `check_foo` once per listed lint.
140144
early_lint_methods!(
141145
declare_combined_early_lint_pass,
142146
[
@@ -162,7 +166,9 @@ early_lint_methods!(
162166
]
163167
);
164168

165-
// FIXME: Make a separate lint type which do not require typeck tables
169+
// FIXME: Make a separate lint type which does not require typeck tables.
170+
171+
// See the comment on `BuiltinCombinedEarlyLintPass`, which is similar.
166172
late_lint_methods!(
167173
declare_combined_late_lint_pass,
168174
[
@@ -182,6 +188,7 @@ late_lint_methods!(
182188
]
183189
);
184190

191+
// See the comment on `BuiltinCombinedEarlyLintPass`, which is similar.
185192
late_lint_methods!(
186193
declare_combined_late_lint_pass,
187194
[

compiler/rustc_lint/src/passes.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ macro_rules! declare_late_lint_pass {
7373
)
7474
}
7575

76+
// Declare the `LateLintPass` trait, which contains empty default definitions
77+
// for all the `check_*` methods.
7678
late_lint_methods!(declare_late_lint_pass, []);
7779

7880
impl LateLintPass<'_> for HardwiredLints {}
@@ -176,6 +178,8 @@ macro_rules! declare_early_lint_pass {
176178
)
177179
}
178180

181+
// Declare the `EarlyLintPass` trait, which contains empty default definitions
182+
// for all the `check_*` methods.
179183
early_lint_methods!(declare_early_lint_pass, []);
180184

181185
#[macro_export]

0 commit comments

Comments
 (0)