@@ -3,7 +3,7 @@ use crate::ty::TyCtxt;
33use rustc_data_structures:: fx:: FxHashSet ;
44use rustc_data_structures:: sync:: { par_iter, Lock , ParallelIterator } ;
55use rustc_hir as hir;
6- use rustc_hir:: def_id:: { DefId , DefIndex , CRATE_DEF_INDEX } ;
6+ use rustc_hir:: def_id:: { DefIndex , LocalDefId , CRATE_DEF_INDEX } ;
77use rustc_hir:: intravisit;
88use rustc_hir:: itemlikevisit:: ItemLikeVisitor ;
99use rustc_hir:: { HirId , ItemLocalId } ;
@@ -113,14 +113,18 @@ impl<'a, 'hir> HirIdValidator<'a, 'hir> {
113113 missing_items. push ( format ! (
114114 "[local_id: {}, owner: {}]" ,
115115 local_id,
116- self . hir_map. def_path( DefId :: local( owner_def_index) ) . to_string_no_crate( )
116+ self . hir_map
117+ . def_path( LocalDefId { local_def_index: owner_def_index } )
118+ . to_string_no_crate( )
117119 ) ) ;
118120 }
119121 self . error ( || {
120122 format ! (
121123 "ItemLocalIds not assigned densely in {}. \
122124 Max ItemLocalId = {}, missing IDs = {:?}; seens IDs = {:?}",
123- self . hir_map. def_path( DefId :: local( owner_def_index) ) . to_string_no_crate( ) ,
125+ self . hir_map
126+ . def_path( LocalDefId { local_def_index: owner_def_index } )
127+ . to_string_no_crate( ) ,
124128 max,
125129 missing_items,
126130 self . hir_ids_seen
@@ -159,8 +163,10 @@ impl<'a, 'hir> intravisit::Visitor<'hir> for HirIdValidator<'a, 'hir> {
159163 format ! (
160164 "HirIdValidator: The recorded owner of {} is {} instead of {}" ,
161165 self . hir_map. node_to_string( hir_id) ,
162- self . hir_map. def_path( DefId :: local( hir_id. owner) ) . to_string_no_crate( ) ,
163- self . hir_map. def_path( DefId :: local( owner) ) . to_string_no_crate( )
166+ self . hir_map. def_path( hir_id. owner_local_def_id( ) ) . to_string_no_crate( ) ,
167+ self . hir_map
168+ . def_path( LocalDefId { local_def_index: owner } )
169+ . to_string_no_crate( )
164170 )
165171 } ) ;
166172 }
0 commit comments