Only store a LocalDefId in hir::TraitItem.
This commit is contained in:
parent
cebbba081e
commit
a871a0f111
45 changed files with 139 additions and 125 deletions
|
@ -586,7 +586,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingDoc {
|
|||
if let hir::VisibilityKind::Inherited = it.vis.node {
|
||||
self.private_traits.insert(it.hir_id());
|
||||
for trait_item_ref in trait_item_refs {
|
||||
self.private_traits.insert(trait_item_ref.id.hir_id);
|
||||
self.private_traits.insert(trait_item_ref.id.hir_id());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -626,16 +626,15 @@ impl<'tcx> LateLintPass<'tcx> for MissingDoc {
|
|||
}
|
||||
|
||||
fn check_trait_item(&mut self, cx: &LateContext<'_>, trait_item: &hir::TraitItem<'_>) {
|
||||
if self.private_traits.contains(&trait_item.hir_id) {
|
||||
if self.private_traits.contains(&trait_item.hir_id()) {
|
||||
return;
|
||||
}
|
||||
|
||||
let def_id = cx.tcx.hir().local_def_id(trait_item.hir_id);
|
||||
let (article, desc) = cx.tcx.article_and_description(def_id.to_def_id());
|
||||
let (article, desc) = cx.tcx.article_and_description(trait_item.def_id.to_def_id());
|
||||
|
||||
self.check_missing_docs_attrs(
|
||||
cx,
|
||||
Some(trait_item.hir_id),
|
||||
Some(trait_item.hir_id()),
|
||||
&trait_item.attrs,
|
||||
trait_item.span,
|
||||
article,
|
||||
|
|
|
@ -301,8 +301,8 @@ impl<'tcx, T: LateLintPass<'tcx>> hir_visit::Visitor<'tcx> for LateContextAndPas
|
|||
fn visit_trait_item(&mut self, trait_item: &'tcx hir::TraitItem<'tcx>) {
|
||||
let generics = self.context.generics.take();
|
||||
self.context.generics = Some(&trait_item.generics);
|
||||
self.with_lint_attrs(trait_item.hir_id, &trait_item.attrs, |cx| {
|
||||
cx.with_param_env(trait_item.hir_id, |cx| {
|
||||
self.with_lint_attrs(trait_item.hir_id(), &trait_item.attrs, |cx| {
|
||||
cx.with_param_env(trait_item.hir_id(), |cx| {
|
||||
lint_callback!(cx, check_trait_item, trait_item);
|
||||
hir_visit::walk_trait_item(cx, trait_item);
|
||||
lint_callback!(cx, check_trait_item_post, trait_item);
|
||||
|
|
|
@ -631,7 +631,7 @@ impl<'tcx> intravisit::Visitor<'tcx> for LintLevelMapBuilder<'_, 'tcx> {
|
|||
}
|
||||
|
||||
fn visit_trait_item(&mut self, trait_item: &'tcx hir::TraitItem<'tcx>) {
|
||||
self.with_lint_attrs(trait_item.hir_id, &trait_item.attrs, |builder| {
|
||||
self.with_lint_attrs(trait_item.hir_id(), &trait_item.attrs, |builder| {
|
||||
intravisit::walk_trait_item(builder, trait_item);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue