File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Expand file tree Collapse file tree 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> {
225225 self . tcx . definitions_untracked ( ) . iter_local_def_id ( )
226226 }
227227
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 > {
229230 let hir_id = self . local_def_id_to_hir_id ( local_def_id) ;
230231 let def_kind = match self . find ( hir_id) ? {
231232 Node :: Item ( item) => match item. kind {
Original file line number Diff line number Diff line change @@ -467,7 +467,7 @@ impl<'tcx> EmbargoVisitor<'tcx> {
467467 }
468468
469469 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 ) {
471471 // The macro's parent doesn't correspond to a `mod`, return early (#63164, #65252).
472472 return ;
473473 }
Original file line number Diff line number Diff line change @@ -291,7 +291,7 @@ macro_rules! define_queries {
291291 // accidentally triggering an infinite query loop.
292292 let def_kind = key. key_as_def_id( )
293293 . 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) ) ;
295295 let hash = || {
296296 let mut hcx = tcx. create_stable_hashing_context( ) ;
297297 let mut hasher = StableHasher :: new( ) ;
You can’t perform that action at this time.
0 commit comments