Skip to content

Commit 2fc6224

Browse files
committed
Rename LintPass::check_trait_method to check_trait_item
Traits can have associated types and not just methods. This clarification reflects the the type of the input the method accepts. [breaking-change]
1 parent 8902936 commit 2fc6224

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/librustc/lint/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for Context<'a, 'tcx> {
612612
}
613613

614614
fn visit_trait_item(&mut self, m: &ast::TraitItem) {
615-
run_lints!(self, check_trait_method, m);
615+
run_lints!(self, check_trait_item, m);
616616
visit::walk_trait_item(self, m);
617617
}
618618

src/librustc/lint/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ pub trait LintPass {
144144
fn check_fn(&mut self, _: &Context,
145145
_: FnKind, _: &ast::FnDecl, _: &ast::Block, _: Span, _: ast::NodeId) { }
146146
fn check_ty_method(&mut self, _: &Context, _: &ast::TypeMethod) { }
147-
fn check_trait_method(&mut self, _: &Context, _: &ast::TraitItem) { }
147+
fn check_trait_item(&mut self, _: &Context, _: &ast::TraitItem) { }
148148
fn check_struct_def(&mut self, _: &Context,
149149
_: &ast::StructDef, _: ast::Ident, _: &ast::Generics, _: ast::NodeId) { }
150150
fn check_struct_def_post(&mut self, _: &Context,

src/librustc_lint/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,7 @@ impl LintPass for MissingDoc {
15771577
tm.span, "a type method");
15781578
}
15791579

1580-
fn check_trait_method(&mut self, cx: &Context, it: &ast::TraitItem) {
1580+
fn check_trait_item(&mut self, cx: &Context, it: &ast::TraitItem) {
15811581
if let ast::TraitItem::TypeTraitItem(ref ty) = *it {
15821582
let assoc_ty = &ty.ty_param;
15831583
self.check_missing_docs_attrs(cx, Some(assoc_ty.id), &ty.attrs,

0 commit comments

Comments
 (0)