@@ -707,7 +707,7 @@ impl EncodeContext<'a, 'tcx> {
707707 is_non_exhaustive : variant. is_field_list_non_exhaustive ( ) ,
708708 } ;
709709
710- let enum_id = tcx. hir ( ) . as_local_hir_id ( def. did . expect_local ( ) ) ;
710+ let enum_id = tcx. hir ( ) . local_def_id_to_hir_id ( def. did . expect_local ( ) ) ;
711711 let enum_vis = & tcx. hir ( ) . expect_item ( enum_id) . vis ;
712712
713713 record ! ( self . tables. kind[ def_id] <- EntryKind :: Variant ( self . lazy( data) ) ) ;
@@ -754,7 +754,7 @@ impl EncodeContext<'a, 'tcx> {
754754
755755 // Variant constructors have the same visibility as the parent enums, unless marked as
756756 // non-exhaustive, in which case they are lowered to `pub(crate)`.
757- let enum_id = tcx. hir ( ) . as_local_hir_id ( def. did . expect_local ( ) ) ;
757+ let enum_id = tcx. hir ( ) . local_def_id_to_hir_id ( def. did . expect_local ( ) ) ;
758758 let enum_vis = & tcx. hir ( ) . expect_item ( enum_id) . vis ;
759759 let mut ctor_vis = ty:: Visibility :: from_hir ( enum_vis, enum_id, tcx) ;
760760 if variant. is_field_list_non_exhaustive ( ) && ctor_vis == ty:: Visibility :: Public {
@@ -793,11 +793,11 @@ impl EncodeContext<'a, 'tcx> {
793793 let data = ModData {
794794 reexports : match tcx. module_exports ( local_def_id) {
795795 Some ( exports) => {
796- let hir_map = self . tcx . hir ( ) ;
796+ let hir = self . tcx . hir ( ) ;
797797 self . lazy (
798798 exports
799799 . iter ( )
800- . map ( |export| export. map_id ( |id| hir_map . as_local_hir_id ( id) ) ) ,
800+ . map ( |export| export. map_id ( |id| hir . local_def_id_to_hir_id ( id) ) ) ,
801801 )
802802 }
803803 _ => Lazy :: empty ( ) ,
@@ -829,7 +829,7 @@ impl EncodeContext<'a, 'tcx> {
829829 let def_id = field. did ;
830830 debug ! ( "EncodeContext::encode_field({:?})" , def_id) ;
831831
832- let variant_id = tcx. hir ( ) . as_local_hir_id ( variant. def_id . expect_local ( ) ) ;
832+ let variant_id = tcx. hir ( ) . local_def_id_to_hir_id ( variant. def_id . expect_local ( ) ) ;
833833 let variant_data = tcx. hir ( ) . expect_variant_data ( variant_id) ;
834834
835835 record ! ( self . tables. kind[ def_id] <- EntryKind :: Field ) ;
@@ -857,7 +857,7 @@ impl EncodeContext<'a, 'tcx> {
857857 is_non_exhaustive : variant. is_field_list_non_exhaustive ( ) ,
858858 } ;
859859
860- let struct_id = tcx. hir ( ) . as_local_hir_id ( adt_def. did . expect_local ( ) ) ;
860+ let struct_id = tcx. hir ( ) . local_def_id_to_hir_id ( adt_def. did . expect_local ( ) ) ;
861861 let struct_vis = & tcx. hir ( ) . expect_item ( struct_id) . vis ;
862862 let mut ctor_vis = ty:: Visibility :: from_hir ( struct_vis, struct_id, tcx) ;
863863 for field in & variant. fields {
@@ -919,7 +919,7 @@ impl EncodeContext<'a, 'tcx> {
919919 debug ! ( "EncodeContext::encode_info_for_trait_item({:?})" , def_id) ;
920920 let tcx = self . tcx ;
921921
922- let hir_id = tcx. hir ( ) . as_local_hir_id ( def_id. expect_local ( ) ) ;
922+ let hir_id = tcx. hir ( ) . local_def_id_to_hir_id ( def_id. expect_local ( ) ) ;
923923 let ast_item = tcx. hir ( ) . expect_trait_item ( hir_id) ;
924924 let trait_item = tcx. associated_item ( def_id) ;
925925
@@ -1008,7 +1008,7 @@ impl EncodeContext<'a, 'tcx> {
10081008 debug ! ( "EncodeContext::encode_info_for_impl_item({:?})" , def_id) ;
10091009 let tcx = self . tcx ;
10101010
1011- let hir_id = self . tcx . hir ( ) . as_local_hir_id ( def_id. expect_local ( ) ) ;
1011+ let hir_id = self . tcx . hir ( ) . local_def_id_to_hir_id ( def_id. expect_local ( ) ) ;
10121012 let ast_item = self . tcx . hir ( ) . expect_impl_item ( hir_id) ;
10131013 let impl_item = self . tcx . associated_item ( def_id) ;
10141014
@@ -1412,7 +1412,7 @@ impl EncodeContext<'a, 'tcx> {
14121412
14131413 // NOTE(eddyb) `tcx.type_of(def_id)` isn't used because it's fully generic,
14141414 // including on the signature, which is inferred in `typeck.
1415- let hir_id = self . tcx . hir ( ) . as_local_hir_id ( def_id) ;
1415+ let hir_id = self . tcx . hir ( ) . local_def_id_to_hir_id ( def_id) ;
14161416 let ty = self . tcx . typeck ( def_id) . node_type ( hir_id) ;
14171417
14181418 record ! ( self . tables. kind[ def_id. to_def_id( ) ] <- match ty. kind {
@@ -1439,7 +1439,7 @@ impl EncodeContext<'a, 'tcx> {
14391439
14401440 fn encode_info_for_anon_const ( & mut self , def_id : LocalDefId ) {
14411441 debug ! ( "EncodeContext::encode_info_for_anon_const({:?})" , def_id) ;
1442- let id = self . tcx . hir ( ) . as_local_hir_id ( def_id) ;
1442+ let id = self . tcx . hir ( ) . local_def_id_to_hir_id ( def_id) ;
14431443 let body_id = self . tcx . hir ( ) . body_owned_by ( id) ;
14441444 let const_data = self . encode_rendered_const_for_body ( body_id) ;
14451445 let qualifs = self . tcx . mir_const_qualif ( def_id) ;
0 commit comments