@@ -37,7 +37,7 @@ use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE, LocalDefId};
37
37
use rustc_hir:: definitions:: { DefPathData , Definitions , DisambiguatorState } ;
38
38
use rustc_hir:: intravisit:: VisitorExt ;
39
39
use rustc_hir:: lang_items:: LangItem ;
40
- use rustc_hir:: { self as hir, Attribute , HirId , Node , TraitCandidate } ;
40
+ use rustc_hir:: { self as hir, Attribute , HirId , MaybeOwner , Node , OwnerInfo , TraitCandidate } ;
41
41
use rustc_index:: IndexVec ;
42
42
use rustc_macros:: { HashStable , TyDecodable , TyEncodable } ;
43
43
use rustc_query_system:: cache:: WithDepNode ;
@@ -1272,6 +1272,11 @@ impl<'tcx> TyCtxt<'tcx> {
1272
1272
TyCtxtFeed { tcx : self , key : ( ) }
1273
1273
}
1274
1274
1275
+ pub fn super_duper_perf_hack_experiment ( self , key : LocalDefId ) -> TyCtxtFeed < ' tcx , LocalDefId > {
1276
+ self . dep_graph . assert_eval_always ( ) ;
1277
+ TyCtxtFeed { tcx : self , key }
1278
+ }
1279
+
1275
1280
/// Only used in the resolver to register the `CRATE_DEF_ID` `DefId` and feed
1276
1281
/// some queries for it. It will panic if used twice.
1277
1282
pub fn create_local_crate_def_id ( self , span : Span ) -> TyCtxtFeed < ' tcx , LocalDefId > {
@@ -1326,24 +1331,25 @@ impl<'tcx> TyCtxtFeed<'tcx, LocalDefId> {
1326
1331
1327
1332
// Fills in all the important parts needed by HIR queries
1328
1333
pub fn feed_hir ( & self ) {
1329
- self . local_def_id_to_hir_id ( HirId :: make_owner ( self . def_id ( ) ) ) ;
1330
-
1331
1334
let node = hir:: OwnerNode :: Synthetic ;
1332
1335
let bodies = Default :: default ( ) ;
1333
- let attrs = hir:: AttributeMap :: EMPTY ;
1334
-
1336
+ let attrs = hir:: AttributeMap :: empty ( ) ;
1335
1337
let ( opt_hash_including_bodies, _) =
1336
1338
self . tcx . hash_owner_nodes ( node, & bodies, & attrs. map , attrs. define_opaque ) ;
1337
1339
let node = node. into ( ) ;
1338
- self . opt_hir_owner_nodes ( Some ( self . tcx . arena . alloc ( hir:: OwnerNodes {
1339
- opt_hash_including_bodies,
1340
- nodes : IndexVec :: from_elem_n (
1341
- hir:: ParentedNode { parent : hir:: ItemLocalId :: INVALID , node } ,
1342
- 1 ,
1343
- ) ,
1344
- bodies,
1340
+ self . hir_owner ( MaybeOwner :: Owner ( self . tcx . arena . alloc ( OwnerInfo {
1341
+ nodes : hir:: OwnerNodes {
1342
+ opt_hash_including_bodies,
1343
+ nodes : IndexVec :: from_elem_n (
1344
+ hir:: ParentedNode { parent : hir:: ItemLocalId :: INVALID , node } ,
1345
+ 1 ,
1346
+ ) ,
1347
+ bodies,
1348
+ } ,
1349
+ parenting : Default :: default ( ) ,
1350
+ attrs,
1351
+ trait_map : Default :: default ( ) ,
1345
1352
} ) ) ) ;
1346
- self . feed_owner_id ( ) . hir_attr_map ( attrs) ;
1347
1353
}
1348
1354
}
1349
1355
0 commit comments