File tree 3 files changed +4
-3
lines changed
3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -225,7 +225,8 @@ impl<'hir> Map<'hir> {
225
225
self . tcx . definitions_untracked ( ) . iter_local_def_id ( )
226
226
}
227
227
228
- pub fn opt_def_kind ( self , local_def_id : LocalDefId ) -> Option < DefKind > {
228
+ /// Do not call this function directly. The query should be called.
229
+ pub ( super ) fn opt_def_kind ( self , local_def_id : LocalDefId ) -> Option < DefKind > {
229
230
let hir_id = self . local_def_id_to_hir_id ( local_def_id) ;
230
231
let def_kind = match self . find ( hir_id) ? {
231
232
Node :: Item ( item) => match item. kind {
Original file line number Diff line number Diff line change @@ -467,7 +467,7 @@ impl<'tcx> EmbargoVisitor<'tcx> {
467
467
}
468
468
469
469
let macro_module_def_id = self . tcx . local_parent ( local_def_id) ;
470
- if self . tcx . hir ( ) . opt_def_kind ( macro_module_def_id) != Some ( DefKind :: Mod ) {
470
+ if self . tcx . opt_def_kind ( macro_module_def_id) != Some ( DefKind :: Mod ) {
471
471
// The macro's parent doesn't correspond to a `mod`, return early (#63164, #65252).
472
472
return ;
473
473
}
Original file line number Diff line number Diff line change @@ -291,7 +291,7 @@ macro_rules! define_queries {
291
291
// accidentally triggering an infinite query loop.
292
292
let def_kind = key. key_as_def_id( )
293
293
. and_then( |def_id| def_id. as_local( ) )
294
- . and_then ( |def_id| tcx. hir ( ) . opt_def_kind ( def_id) ) ;
294
+ . map ( |def_id| tcx. def_kind ( def_id) ) ;
295
295
let hash = || {
296
296
let mut hcx = tcx. create_stable_hashing_context( ) ;
297
297
let mut hasher = StableHasher :: new( ) ;
You can’t perform that action at this time.
0 commit comments