fix a couple more uses of def_kind
This commit is contained in:
parent
d00f94ffc1
commit
087c0d7ea9
@ -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()
|
||||
});
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user