@@ -361,17 +361,15 @@ impl<'sess> rustc_middle::ty::OnDiskCache<'sess> for OnDiskCache<'sess> {
361361 } )
362362 }
363363
364- fn def_path_hash_to_def_id ( & self , tcx : TyCtxt < ' tcx > , hash : DefPathHash ) -> Option < DefId > {
364+ fn def_path_hash_to_def_id ( & self , tcx : TyCtxt < ' tcx > , hash : DefPathHash ) -> DefId {
365365 debug ! ( "def_path_hash_to_def_id({:?})" , hash) ;
366366
367367 let stable_crate_id = hash. stable_crate_id ( ) ;
368368
369369 // If this is a DefPathHash from the local crate, we can look up the
370370 // DefId in the tcx's `Definitions`.
371371 if stable_crate_id == tcx. sess . local_stable_crate_id ( ) {
372- tcx. definitions_untracked ( )
373- . local_def_path_hash_to_def_id ( hash)
374- . map ( LocalDefId :: to_def_id)
372+ tcx. definitions_untracked ( ) . local_def_path_hash_to_def_id ( hash) . to_def_id ( )
375373 } else {
376374 // If this is a DefPathHash from an upstream crate, let the CrateStore map
377375 // it to a DefId.
@@ -779,12 +777,7 @@ impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for DefId {
779777 // If we get to this point, then all of the query inputs were green,
780778 // which means that the definition with this hash is guaranteed to
781779 // still exist in the current compilation session.
782- Ok ( d. tcx ( )
783- . on_disk_cache
784- . as_ref ( )
785- . unwrap ( )
786- . def_path_hash_to_def_id ( d. tcx ( ) , def_path_hash)
787- . unwrap ( ) )
780+ Ok ( d. tcx ( ) . on_disk_cache . as_ref ( ) . unwrap ( ) . def_path_hash_to_def_id ( d. tcx ( ) , def_path_hash) )
788781 }
789782}
790783
0 commit comments