Skip to content

Commit 74e9a29

Browse files
committed
Remove some late check_* functions.
They're not used by rustc or clippy.
1 parent 6dced80 commit 74e9a29

File tree

3 files changed

+2
-34
lines changed

3 files changed

+2
-34
lines changed

compiler/rustc_lint/src/late.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ impl<'tcx, T: LateLintPass<'tcx>> LateContextAndPass<'tcx, T> {
8181
fn process_mod(&mut self, m: &'tcx hir::Mod<'tcx>, s: Span, n: hir::HirId) {
8282
lint_callback!(self, check_mod, m, s, n);
8383
hir_visit::walk_mod(self, m, n);
84-
lint_callback!(self, check_mod_post, m, s, n);
8584
}
8685
}
8786

@@ -118,7 +117,6 @@ impl<'tcx, T: LateLintPass<'tcx>> hir_visit::Visitor<'tcx> for LateContextAndPas
118117

119118
fn visit_param(&mut self, param: &'tcx hir::Param<'tcx>) {
120119
self.with_lint_attrs(param.hir_id, |cx| {
121-
lint_callback!(cx, check_param, param);
122120
hir_visit::walk_param(cx, param);
123121
});
124122
}
@@ -151,7 +149,6 @@ impl<'tcx, T: LateLintPass<'tcx>> hir_visit::Visitor<'tcx> for LateContextAndPas
151149
cx.with_param_env(it.hir_id(), |cx| {
152150
lint_callback!(cx, check_foreign_item, it);
153151
hir_visit::walk_foreign_item(cx, it);
154-
lint_callback!(cx, check_foreign_item_post, it);
155152
});
156153
})
157154
}
@@ -193,7 +190,6 @@ impl<'tcx, T: LateLintPass<'tcx>> hir_visit::Visitor<'tcx> for LateContextAndPas
193190
let body = self.context.tcx.hir().body(body_id);
194191
lint_callback!(self, check_fn, fk, decl, body, span, id);
195192
hir_visit::walk_fn(self, fk, decl, body_id, span, id);
196-
lint_callback!(self, check_fn_post, fk, decl, body, span, id);
197193
self.context.enclosing_body = old_enclosing_body;
198194
self.context.cached_typeck_results.set(old_cached_typeck_results);
199195
}
@@ -208,7 +204,6 @@ impl<'tcx, T: LateLintPass<'tcx>> hir_visit::Visitor<'tcx> for LateContextAndPas
208204
) {
209205
lint_callback!(self, check_struct_def, s);
210206
hir_visit::walk_struct_def(self, s);
211-
lint_callback!(self, check_struct_def_post, s);
212207
}
213208

214209
fn visit_field_def(&mut self, s: &'tcx hir::FieldDef<'tcx>) {
@@ -227,7 +222,6 @@ impl<'tcx, T: LateLintPass<'tcx>> hir_visit::Visitor<'tcx> for LateContextAndPas
227222
self.with_lint_attrs(v.id, |cx| {
228223
lint_callback!(cx, check_variant, v);
229224
hir_visit::walk_variant(cx, v, g, item_id);
230-
lint_callback!(cx, check_variant_post, v);
231225
})
232226
}
233227

@@ -237,14 +231,9 @@ impl<'tcx, T: LateLintPass<'tcx>> hir_visit::Visitor<'tcx> for LateContextAndPas
237231
}
238232

239233
fn visit_infer(&mut self, inf: &'tcx hir::InferArg) {
240-
lint_callback!(self, check_infer, inf);
241234
hir_visit::walk_inf(self, inf);
242235
}
243236

244-
fn visit_name(&mut self, sp: Span, name: Symbol) {
245-
lint_callback!(self, check_name, sp, name);
246-
}
247-
248237
fn visit_mod(&mut self, m: &'tcx hir::Mod<'tcx>, s: Span, n: hir::HirId) {
249238
if !self.context.only_module {
250239
self.process_mod(m, s, n);
@@ -280,7 +269,6 @@ impl<'tcx, T: LateLintPass<'tcx>> hir_visit::Visitor<'tcx> for LateContextAndPas
280269
}
281270

282271
fn visit_where_predicate(&mut self, p: &'tcx hir::WherePredicate<'tcx>) {
283-
lint_callback!(self, check_where_predicate, p);
284272
hir_visit::walk_where_predicate(self, p);
285273
}
286274

@@ -300,7 +288,6 @@ impl<'tcx, T: LateLintPass<'tcx>> hir_visit::Visitor<'tcx> for LateContextAndPas
300288
cx.with_param_env(trait_item.hir_id(), |cx| {
301289
lint_callback!(cx, check_trait_item, trait_item);
302290
hir_visit::walk_trait_item(cx, trait_item);
303-
lint_callback!(cx, check_trait_item_post, trait_item);
304291
});
305292
});
306293
self.context.generics = generics;
@@ -320,7 +307,6 @@ impl<'tcx, T: LateLintPass<'tcx>> hir_visit::Visitor<'tcx> for LateContextAndPas
320307
}
321308

322309
fn visit_lifetime(&mut self, lt: &'tcx hir::Lifetime) {
323-
lint_callback!(self, check_lifetime, lt);
324310
hir_visit::walk_lifetime(self, lt);
325311
}
326312

compiler/rustc_lint/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ use rustc_middle::ty::TyCtxt;
7575
use rustc_session::lint::builtin::{
7676
BARE_TRAIT_OBJECTS, ELIDED_LIFETIMES_IN_PATHS, EXPLICIT_OUTLIVES_REQUIREMENTS,
7777
};
78-
use rustc_span::symbol::{Ident, Symbol};
78+
use rustc_span::symbol::Ident;
7979
use rustc_span::Span;
8080

8181
use array_into_iter::ArrayIntoIter;

compiler/rustc_lint/src/passes.rs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,19 @@ use rustc_data_structures::sync;
55
use rustc_hir as hir;
66
use rustc_session::lint::builtin::HardwiredLints;
77
use rustc_session::lint::LintPass;
8-
use rustc_span::symbol::{Ident, Symbol};
8+
use rustc_span::symbol::Ident;
99
use rustc_span::Span;
1010

1111
#[macro_export]
1212
macro_rules! late_lint_methods {
1313
($macro:path, $args:tt, [$hir:tt]) => (
1414
$macro!($args, [$hir], [
15-
fn check_param(a: &$hir hir::Param<$hir>);
1615
fn check_body(a: &$hir hir::Body<$hir>);
1716
fn check_body_post(a: &$hir hir::Body<$hir>);
18-
fn check_name(a: Span, b: Symbol);
1917
fn check_crate();
2018
fn check_crate_post();
2119
fn check_mod(a: &$hir hir::Mod<$hir>, b: Span, c: hir::HirId);
22-
fn check_mod_post(a: &$hir hir::Mod<$hir>, b: Span, c: hir::HirId);
2320
fn check_foreign_item(a: &$hir hir::ForeignItem<$hir>);
24-
fn check_foreign_item_post(a: &$hir hir::ForeignItem<$hir>);
2521
fn check_item(a: &$hir hir::Item<$hir>);
2622
fn check_item_post(a: &$hir hir::Item<$hir>);
2723
fn check_local(a: &$hir hir::Local<$hir>);
@@ -33,35 +29,21 @@ macro_rules! late_lint_methods {
3329
fn check_expr(a: &$hir hir::Expr<$hir>);
3430
fn check_expr_post(a: &$hir hir::Expr<$hir>);
3531
fn check_ty(a: &$hir hir::Ty<$hir>);
36-
fn check_infer(a: &$hir hir::InferArg);
37-
fn check_generic_arg(a: &$hir hir::GenericArg<$hir>);
3832
fn check_generic_param(a: &$hir hir::GenericParam<$hir>);
3933
fn check_generics(a: &$hir hir::Generics<$hir>);
40-
fn check_where_predicate(a: &$hir hir::WherePredicate<$hir>);
4134
fn check_poly_trait_ref(a: &$hir hir::PolyTraitRef<$hir>, b: hir::TraitBoundModifier);
4235
fn check_fn(
4336
a: rustc_hir::intravisit::FnKind<$hir>,
4437
b: &$hir hir::FnDecl<$hir>,
4538
c: &$hir hir::Body<$hir>,
4639
d: Span,
4740
e: hir::HirId);
48-
fn check_fn_post(
49-
a: rustc_hir::intravisit::FnKind<$hir>,
50-
b: &$hir hir::FnDecl<$hir>,
51-
c: &$hir hir::Body<$hir>,
52-
d: Span,
53-
e: hir::HirId
54-
);
5541
fn check_trait_item(a: &$hir hir::TraitItem<$hir>);
56-
fn check_trait_item_post(a: &$hir hir::TraitItem<$hir>);
5742
fn check_impl_item(a: &$hir hir::ImplItem<$hir>);
5843
fn check_impl_item_post(a: &$hir hir::ImplItem<$hir>);
5944
fn check_struct_def(a: &$hir hir::VariantData<$hir>);
60-
fn check_struct_def_post(a: &$hir hir::VariantData<$hir>);
6145
fn check_field_def(a: &$hir hir::FieldDef<$hir>);
6246
fn check_variant(a: &$hir hir::Variant<$hir>);
63-
fn check_variant_post(a: &$hir hir::Variant<$hir>);
64-
fn check_lifetime(a: &$hir hir::Lifetime);
6547
fn check_path(a: &$hir hir::Path<$hir>, b: hir::HirId);
6648
fn check_attribute(a: &$hir ast::Attribute);
6749

0 commit comments

Comments
 (0)