Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix a couple more uses of def_kind
  • Loading branch information
mark-i-m committed Apr 24, 2020
1 parent d00f94f commit 087c0d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/librustc_passes/dead.rs
Expand Up @@ -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()
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_passes/stability.rs
Expand Up @@ -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));
}
}
Expand Down

0 comments on commit 087c0d7

Please sign in to comment.