review comments
This commit is contained in:
parent
dc71166037
commit
2375b8ae7e
2 changed files with 2 additions and 2 deletions
|
@ -1598,7 +1598,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||||
.filter(|item| item.kind == AssocKind::Fn && item.defaultness.has_value())
|
.filter(|item| item.kind == AssocKind::Fn && item.defaultness.has_value())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn item_name_from_hir(self, def_id: DefId) -> Option<Ident> {
|
fn item_name_from_hir(self, def_id: DefId) -> Option<Ident> {
|
||||||
self.hir().get_if_local(def_id).and_then(|node| node.ident())
|
self.hir().get_if_local(def_id).and_then(|node| node.ident())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2072,7 +2072,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
|
||||||
if !is_upvar_tys_infer_tuple {
|
if !is_upvar_tys_infer_tuple {
|
||||||
let msg = format!("required because it appears within the type `{}`", ty);
|
let msg = format!("required because it appears within the type `{}`", ty);
|
||||||
match ty.kind() {
|
match ty.kind() {
|
||||||
ty::Adt(def, _) => match self.tcx.item_name_from_hir(def.did) {
|
ty::Adt(def, _) => match self.tcx.opt_item_name(def.did) {
|
||||||
Some(ident) => err.span_note(ident.span, &msg),
|
Some(ident) => err.span_note(ident.span, &msg),
|
||||||
None => err.note(&msg),
|
None => err.note(&msg),
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue