@@ -361,17 +361,15 @@ impl<'sess> rustc_middle::ty::OnDiskCache<'sess> for OnDiskCache<'sess> {
361
361
} )
362
362
}
363
363
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 {
365
365
debug ! ( "def_path_hash_to_def_id({:?})" , hash) ;
366
366
367
367
let stable_crate_id = hash. stable_crate_id ( ) ;
368
368
369
369
// If this is a DefPathHash from the local crate, we can look up the
370
370
// DefId in the tcx's `Definitions`.
371
371
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 ( )
375
373
} else {
376
374
// If this is a DefPathHash from an upstream crate, let the CrateStore map
377
375
// it to a DefId.
@@ -779,12 +777,7 @@ impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for DefId {
779
777
// If we get to this point, then all of the query inputs were green,
780
778
// which means that the definition with this hash is guaranteed to
781
779
// 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) )
788
781
}
789
782
}
790
783
0 commit comments