Correct descriptive item name for impl
This commit is contained in:
parent
03d4fd973a
commit
bb1eed0ec8
2 changed files with 3 additions and 5 deletions
|
|
@ -2288,7 +2288,7 @@ impl ItemKind {
|
|||
ItemKind::Union(..) => "union",
|
||||
ItemKind::Trait(..) => "trait",
|
||||
ItemKind::TraitAlias(..) => "trait alias",
|
||||
ItemKind::Impl(..) => "item",
|
||||
ItemKind::Impl(..) => "impl",
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -350,8 +350,6 @@ impl<'a, 'tcx> Visitor<'tcx> for MissingStabilityAnnotations<'a, 'tcx> {
|
|||
// optional. They inherit stability from their parents when unannotated.
|
||||
hir::ItemKind::Impl(.., None, _, _) | hir::ItemKind::ForeignMod(..) => {}
|
||||
|
||||
hir::ItemKind::Mod(..) => self.check_missing_stability(i.id, i.span, "module"),
|
||||
|
||||
_ => self.check_missing_stability(i.id, i.span, i.node.descriptive_variant())
|
||||
}
|
||||
|
||||
|
|
@ -359,14 +357,14 @@ impl<'a, 'tcx> Visitor<'tcx> for MissingStabilityAnnotations<'a, 'tcx> {
|
|||
}
|
||||
|
||||
fn visit_trait_item(&mut self, ti: &'tcx hir::TraitItem) {
|
||||
self.check_missing_stability(ti.id, ti.span, "node");
|
||||
self.check_missing_stability(ti.id, ti.span, "item");
|
||||
intravisit::walk_trait_item(self, ti);
|
||||
}
|
||||
|
||||
fn visit_impl_item(&mut self, ii: &'tcx hir::ImplItem) {
|
||||
let impl_def_id = self.tcx.hir().local_def_id(self.tcx.hir().get_parent(ii.id));
|
||||
if self.tcx.impl_trait_ref(impl_def_id).is_none() {
|
||||
self.check_missing_stability(ii.id, ii.span, "node");
|
||||
self.check_missing_stability(ii.id, ii.span, "item");
|
||||
}
|
||||
intravisit::walk_impl_item(self, ii);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue