Skip to content

Commit

Permalink
Remove unused from_hir call
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 committed Nov 7, 2020
1 parent 67d0db6 commit f60fd49
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions compiler/rustc_middle/src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`].
Expand Down

0 comments on commit f60fd49

Please sign in to comment.