Skip to content

Commit bb1eed0

Browse files
committed
Correct descriptive item name for impl
1 parent 03d4fd9 commit bb1eed0

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/librustc/hir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2288,7 +2288,7 @@ impl ItemKind {
22882288
ItemKind::Union(..) => "union",
22892289
ItemKind::Trait(..) => "trait",
22902290
ItemKind::TraitAlias(..) => "trait alias",
2291-
ItemKind::Impl(..) => "item",
2291+
ItemKind::Impl(..) => "impl",
22922292
}
22932293
}
22942294

src/librustc/middle/stability.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,23 +350,21 @@ impl<'a, 'tcx> Visitor<'tcx> for MissingStabilityAnnotations<'a, 'tcx> {
350350
// optional. They inherit stability from their parents when unannotated.
351351
hir::ItemKind::Impl(.., None, _, _) | hir::ItemKind::ForeignMod(..) => {}
352352

353-
hir::ItemKind::Mod(..) => self.check_missing_stability(i.id, i.span, "module"),
354-
355353
_ => self.check_missing_stability(i.id, i.span, i.node.descriptive_variant())
356354
}
357355

358356
intravisit::walk_item(self, i)
359357
}
360358

361359
fn visit_trait_item(&mut self, ti: &'tcx hir::TraitItem) {
362-
self.check_missing_stability(ti.id, ti.span, "node");
360+
self.check_missing_stability(ti.id, ti.span, "item");
363361
intravisit::walk_trait_item(self, ti);
364362
}
365363

366364
fn visit_impl_item(&mut self, ii: &'tcx hir::ImplItem) {
367365
let impl_def_id = self.tcx.hir().local_def_id(self.tcx.hir().get_parent(ii.id));
368366
if self.tcx.impl_trait_ref(impl_def_id).is_none() {
369-
self.check_missing_stability(ii.id, ii.span, "node");
367+
self.check_missing_stability(ii.id, ii.span, "item");
370368
}
371369
intravisit::walk_impl_item(self, ii);
372370
}

0 commit comments

Comments
 (0)