提交 2fc62244 编写于 作者: I Ivan Petkov

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]
上级 89029365
......@@ -612,7 +612,7 @@ fn visit_generics(&mut self, g: &ast::Generics) {
}
fn visit_trait_item(&mut self, m: &ast::TraitItem) {
run_lints!(self, check_trait_method, m);
run_lints!(self, check_trait_item, m);
visit::walk_trait_item(self, m);
}
......
......@@ -144,7 +144,7 @@ fn check_generics(&mut self, _: &Context, _: &ast::Generics) { }
fn check_fn(&mut self, _: &Context,
_: FnKind, _: &ast::FnDecl, _: &ast::Block, _: Span, _: ast::NodeId) { }
fn check_ty_method(&mut self, _: &Context, _: &ast::TypeMethod) { }
fn check_trait_method(&mut self, _: &Context, _: &ast::TraitItem) { }
fn check_trait_item(&mut self, _: &Context, _: &ast::TraitItem) { }
fn check_struct_def(&mut self, _: &Context,
_: &ast::StructDef, _: ast::Ident, _: &ast::Generics, _: ast::NodeId) { }
fn check_struct_def_post(&mut self, _: &Context,
......
......@@ -1577,7 +1577,7 @@ fn check_ty_method(&mut self, cx: &Context, tm: &ast::TypeMethod) {
tm.span, "a type method");
}
fn check_trait_method(&mut self, cx: &Context, it: &ast::TraitItem) {
fn check_trait_item(&mut self, cx: &Context, it: &ast::TraitItem) {
if let ast::TraitItem::TypeTraitItem(ref ty) = *it {
let assoc_ty = &ty.ty_param;
self.check_missing_docs_attrs(cx, Some(assoc_ty.id), &ty.attrs,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册