about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2021-03-31 12:10:24 -0700
committerEsteban Küber <esteban@kuber.com.ar>2021-04-06 19:55:45 -0700
commit2375b8ae7e57c7fc068a43138bd3da8c670c8c8d (patch)
tree58c180bf4cae47aed6ee3ff0c428701278eefd42
parentdc711660377685d057ac37431143e2511ba7065f (diff)
downloadrust-2375b8ae7e57c7fc068a43138bd3da8c670c8c8d.tar.gz
rust-2375b8ae7e57c7fc068a43138bd3da8c670c8c8d.zip
review comments
-rw-r--r--compiler/rustc_middle/src/ty/mod.rs2
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs
index 414e1979c94..6574c938260 100644
--- a/compiler/rustc_middle/src/ty/mod.rs
+++ b/compiler/rustc_middle/src/ty/mod.rs
@@ -1598,7 +1598,7 @@ impl<'tcx> TyCtxt<'tcx> {
             .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())
     }
 
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
index edbef02df45..68e7accd34b 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
@@ -2072,7 +2072,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
                 if !is_upvar_tys_infer_tuple {
                     let msg = format!("required because it appears within the type `{}`", ty);
                     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),
                             None => err.note(&msg),
                         },