Skip to content

Commit

Permalink
Correct descriptive item name for impl
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Feb 8, 2019
1 parent 03d4fd9 commit bb1eed0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/librustc/hir/mod.rs
Expand Up @@ -2288,7 +2288,7 @@ impl ItemKind {
ItemKind::Union(..) => "union",
ItemKind::Trait(..) => "trait",
ItemKind::TraitAlias(..) => "trait alias",
ItemKind::Impl(..) => "item",
ItemKind::Impl(..) => "impl",
}
}

Expand Down
6 changes: 2 additions & 4 deletions src/librustc/middle/stability.rs
Expand Up @@ -350,23 +350,21 @@ 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())
}

intravisit::walk_item(self, i)
}

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);
}
Expand Down

0 comments on commit bb1eed0

Please sign in to comment.