about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2020-11-07 10:34:00 -0500
committerJoshua Nelson <jyn514@gmail.com>2020-11-07 10:37:18 -0500
commitf60fd4963207bd6ac4a1c93c7c2674a7c321ffa8 (patch)
treecea87a85f20de71dac771947d65d5ced0288c069
parent67d0db6b008f98c1a1ba8ed6c267105433250fc9 (diff)
downloadrust-f60fd4963207bd6ac4a1c93c7c2674a7c321ffa8.tar.gz
rust-f60fd4963207bd6ac4a1c93c7c2674a7c321ffa8.zip
Remove unused `from_hir` call
-rw-r--r--compiler/rustc_middle/src/ty/mod.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs
index c69dabda549..0042b4a3a42 100644
--- a/compiler/rustc_middle/src/ty/mod.rs
+++ b/compiler/rustc_middle/src/ty/mod.rs
@@ -2827,11 +2827,9 @@ impl<'tcx> TyCtxt<'tcx> {
     pub fn item_name(self, id: DefId) -> Symbol {
         // Look at cross-crate items first to avoid invalidating the incremental cache
         // unless we have to.
-        self.item_name_from_def_id(id)
-            .or_else(|| self.item_name_from_hir(id).map(|ident| ident.name))
-            .unwrap_or_else(|| {
-                bug!("item_name: no name for {:?}", self.def_path(id));
-            })
+        self.item_name_from_def_id(id).unwrap_or_else(|| {
+            bug!("item_name: no name for {:?}", self.def_path(id));
+        })
     }
 
     /// Look up the name and span of an item or [`Node`].