@@ -3,7 +3,7 @@ use crate::ty::TyCtxt;
3
3
use rustc_data_structures:: fx:: FxHashSet ;
4
4
use rustc_data_structures:: sync:: { par_iter, Lock , ParallelIterator } ;
5
5
use 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 } ;
7
7
use rustc_hir:: intravisit;
8
8
use rustc_hir:: itemlikevisit:: ItemLikeVisitor ;
9
9
use rustc_hir:: { HirId , ItemLocalId } ;
@@ -113,14 +113,18 @@ impl<'a, 'hir> HirIdValidator<'a, 'hir> {
113
113
missing_items. push ( format ! (
114
114
"[local_id: {}, owner: {}]" ,
115
115
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( )
117
119
) ) ;
118
120
}
119
121
self . error ( || {
120
122
format ! (
121
123
"ItemLocalIds not assigned densely in {}. \
122
124
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( ) ,
124
128
max,
125
129
missing_items,
126
130
self . hir_ids_seen
@@ -159,8 +163,10 @@ impl<'a, 'hir> intravisit::Visitor<'hir> for HirIdValidator<'a, 'hir> {
159
163
format ! (
160
164
"HirIdValidator: The recorded owner of {} is {} instead of {}" ,
161
165
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( )
164
170
)
165
171
} ) ;
166
172
}
0 commit comments