Skip to content

Commit ab44b5a

Browse files
committed
Remove some early check_* functions.
They're not used by rustc or clippy.
1 parent bdf520f commit ab44b5a

File tree

2 files changed

+0
-36
lines changed

2 files changed

+0
-36
lines changed

compiler/rustc_lint/src/early.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
9090

9191
fn visit_foreign_item(&mut self, it: &'a ast::ForeignItem) {
9292
self.with_lint_attrs(it.id, &it.attrs, |cx| {
93-
run_early_pass!(cx, check_foreign_item, it);
9493
ast_visit::walk_foreign_item(cx, it);
95-
run_early_pass!(cx, check_foreign_item_post, it);
9694
})
9795
}
9896

@@ -104,7 +102,6 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
104102
}
105103

106104
fn visit_anon_const(&mut self, c: &'a ast::AnonConst) {
107-
run_early_pass!(self, check_anon_const, c);
108105
self.check_id(c.id);
109106
ast_visit::walk_anon_const(self, c);
110107
}
@@ -154,22 +151,17 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
154151
self.check_id(closure_id);
155152
}
156153
}
157-
158-
run_early_pass!(self, check_fn_post, fk, span, id);
159154
}
160155

161156
fn visit_variant_data(&mut self, s: &'a ast::VariantData) {
162-
run_early_pass!(self, check_struct_def, s);
163157
if let Some(ctor_hir_id) = s.ctor_id() {
164158
self.check_id(ctor_hir_id);
165159
}
166160
ast_visit::walk_struct_def(self, s);
167-
run_early_pass!(self, check_struct_def_post, s);
168161
}
169162

170163
fn visit_field_def(&mut self, s: &'a ast::FieldDef) {
171164
self.with_lint_attrs(s.id, &s.attrs, |cx| {
172-
run_early_pass!(cx, check_field_def, s);
173165
ast_visit::walk_field_def(cx, s);
174166
})
175167
}
@@ -178,7 +170,6 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
178170
self.with_lint_attrs(v.id, &v.attrs, |cx| {
179171
run_early_pass!(cx, check_variant, v);
180172
ast_visit::walk_variant(cx, v);
181-
run_early_pass!(cx, check_variant_post, v);
182173
})
183174
}
184175

@@ -203,7 +194,6 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
203194
run_early_pass!(self, check_block, b);
204195
self.check_id(b.id);
205196
ast_visit::walk_block(self, b);
206-
run_early_pass!(self, check_block_post, b);
207197
}
208198

209199
fn visit_arm(&mut self, a: &'a ast::Arm) {
@@ -214,8 +204,6 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
214204
}
215205

216206
fn visit_expr_post(&mut self, e: &'a ast::Expr) {
217-
run_early_pass!(self, check_expr_post, e);
218-
219207
// Explicitly check for lints associated with 'closure_id', since
220208
// it does not have a corresponding AST node
221209
match e.kind {
@@ -242,7 +230,6 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
242230
}
243231

244232
fn visit_where_predicate(&mut self, p: &'a ast::WherePredicate) {
245-
run_early_pass!(self, check_where_predicate, p);
246233
ast_visit::walk_where_predicate(self, p);
247234
}
248235

@@ -256,23 +243,19 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
256243
ast_visit::AssocCtxt::Trait => {
257244
run_early_pass!(cx, check_trait_item, item);
258245
ast_visit::walk_assoc_item(cx, item, ctxt);
259-
run_early_pass!(cx, check_trait_item_post, item);
260246
}
261247
ast_visit::AssocCtxt::Impl => {
262248
run_early_pass!(cx, check_impl_item, item);
263249
ast_visit::walk_assoc_item(cx, item, ctxt);
264-
run_early_pass!(cx, check_impl_item_post, item);
265250
}
266251
});
267252
}
268253

269254
fn visit_lifetime(&mut self, lt: &'a ast::Lifetime, _: ast_visit::LifetimeCtxt) {
270-
run_early_pass!(self, check_lifetime, lt);
271255
self.check_id(lt.id);
272256
}
273257

274258
fn visit_path(&mut self, p: &'a ast::Path, id: ast::NodeId) {
275-
run_early_pass!(self, check_path, p, id);
276259
self.check_id(id);
277260
ast_visit::walk_path(self, p);
278261
}

compiler/rustc_lint/src/passes.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -161,44 +161,25 @@ macro_rules! early_lint_methods {
161161
fn check_ident(a: Ident);
162162
fn check_crate(a: &ast::Crate);
163163
fn check_crate_post(a: &ast::Crate);
164-
fn check_foreign_item(a: &ast::ForeignItem);
165-
fn check_foreign_item_post(a: &ast::ForeignItem);
166164
fn check_item(a: &ast::Item);
167165
fn check_item_post(a: &ast::Item);
168166
fn check_local(a: &ast::Local);
169167
fn check_block(a: &ast::Block);
170-
fn check_block_post(a: &ast::Block);
171168
fn check_stmt(a: &ast::Stmt);
172169
fn check_arm(a: &ast::Arm);
173170
fn check_pat(a: &ast::Pat);
174-
fn check_anon_const(a: &ast::AnonConst);
175171
fn check_pat_post(a: &ast::Pat);
176172
fn check_expr(a: &ast::Expr);
177-
fn check_expr_post(a: &ast::Expr);
178173
fn check_ty(a: &ast::Ty);
179174
fn check_generic_arg(a: &ast::GenericArg);
180175
fn check_generic_param(a: &ast::GenericParam);
181176
fn check_generics(a: &ast::Generics);
182-
fn check_where_predicate(a: &ast::WherePredicate);
183177
fn check_poly_trait_ref(a: &ast::PolyTraitRef,
184178
b: &ast::TraitBoundModifier);
185179
fn check_fn(a: rustc_ast::visit::FnKind<'_>, c: Span, d_: ast::NodeId);
186-
fn check_fn_post(
187-
a: rustc_ast::visit::FnKind<'_>,
188-
c: Span,
189-
d: ast::NodeId
190-
);
191180
fn check_trait_item(a: &ast::AssocItem);
192-
fn check_trait_item_post(a: &ast::AssocItem);
193181
fn check_impl_item(a: &ast::AssocItem);
194-
fn check_impl_item_post(a: &ast::AssocItem);
195-
fn check_struct_def(a: &ast::VariantData);
196-
fn check_struct_def_post(a: &ast::VariantData);
197-
fn check_field_def(a: &ast::FieldDef);
198182
fn check_variant(a: &ast::Variant);
199-
fn check_variant_post(a: &ast::Variant);
200-
fn check_lifetime(a: &ast::Lifetime);
201-
fn check_path(a: &ast::Path, b: ast::NodeId);
202183
fn check_attribute(a: &ast::Attribute);
203184
fn check_mac_def(a: &ast::MacroDef, b: ast::NodeId);
204185
fn check_mac(a: &ast::MacCall);

0 commit comments

Comments
 (0)