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 @@ fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, impl_item: &'tcx hir::
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 @@ fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, impl_item: &'tcx hir::
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 @@ fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::ImplI
},
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,