mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-13 08:27:14 +00:00
Merge branch 'pr-2939' into HEAD
This commit is contained in:
commit
77b0300a55
4 changed files with 5 additions and 1 deletions
|
@ -177,6 +177,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc {
|
|||
hir::ImplItemKind::Const(..) => "an associated constant",
|
||||
hir::ImplItemKind::Method(..) => "a method",
|
||||
hir::ImplItemKind::Type(_) => "an associated type",
|
||||
hir::ImplItemKind::Existential(_) => "an existential type",
|
||||
};
|
||||
self.check_missing_docs_attrs(cx, &impl_item.attrs, impl_item.span, desc);
|
||||
}
|
||||
|
|
|
@ -165,7 +165,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingInline {
|
|||
let desc = match impl_item.node {
|
||||
hir::ImplItemKind::Method(..) => "a method",
|
||||
hir::ImplItemKind::Const(..) |
|
||||
hir::ImplItemKind::Type(_) => return,
|
||||
hir::ImplItemKind::Type(_) |
|
||||
hir::ImplItemKind::Existential(_) => return,
|
||||
};
|
||||
|
||||
let def_id = cx.tcx.hir.local_def_id(impl_item.id);
|
||||
|
|
|
@ -70,6 +70,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
|
|||
},
|
||||
hir::ImplItemKind::Method(..) => println!("method"),
|
||||
hir::ImplItemKind::Type(_) => println!("associated type"),
|
||||
hir::ImplItemKind::Existential(_) => println!("existential type"),
|
||||
}
|
||||
}
|
||||
// fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx
|
||||
|
|
|
@ -982,6 +982,7 @@ pub fn opt_def_id(def: Def) -> Option<DefId> {
|
|||
Def::AssociatedConst(id) |
|
||||
Def::Macro(id, ..) |
|
||||
Def::Existential(id) |
|
||||
Def::AssociatedExistential(id) |
|
||||
Def::GlobalAsm(id) => Some(id),
|
||||
|
||||
Def::Upvar(..) | Def::Local(_) | Def::Label(..) | Def::PrimTy(..) | Def::SelfTy(..) | Def::Err => None,
|
||||
|
|
Loading…
Reference in a new issue