Merge branch 'pr-2939' into HEAD

This commit is contained in:
Manish Goregaokar 2018-07-20 00:51:57 -07:00
commit 77b0300a55
4 changed files with 5 additions and 1 deletions

View file

@ -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);
}

View file

@ -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);

View file

@ -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

View file

@ -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,