fix a couple more uses of def_kind

This commit is contained in:
mark 2020-04-24 14:26:11 -05:00
parent d00f94ffc1
commit 087c0d7ea9
2 changed files with 2 additions and 2 deletions

View File

@ -558,7 +558,7 @@ impl DeadVisitor<'tcx> {
if !name.as_str().starts_with('_') {
self.tcx.struct_span_lint_hir(lint::builtin::DEAD_CODE, id, span, |lint| {
let def_id = self.tcx.hir().local_def_id(id);
let descr = self.tcx.def_kind(def_id).descr(def_id);
let descr = self.tcx.def_kind(def_id).descr(def_id.to_def_id());
lint.build(&format!("{} is never {}: `{}`", descr, participle, name)).emit()
});
}

View File

@ -343,7 +343,7 @@ impl<'a, 'tcx> MissingStabilityAnnotations<'a, 'tcx> {
!self.tcx.sess.opts.test && stab.is_none() && self.access_levels.is_reachable(hir_id);
if is_error {
let def_id = self.tcx.hir().local_def_id(hir_id);
let descr = self.tcx.def_kind(def_id).descr(def_id);
let descr = self.tcx.def_kind(def_id).descr(def_id.to_def_id());
self.tcx.sess.span_err(span, &format!("{} has missing stability attribute", descr));
}
}