@@ -35,7 +35,7 @@ use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE, LocalDefId};
3535use rustc_hir:: definitions:: Definitions ;
3636use rustc_hir:: intravisit:: VisitorExt ;
3737use rustc_hir:: lang_items:: LangItem ;
38- use rustc_hir:: { self as hir, Attribute , HirId , Node , TraitCandidate } ;
38+ use rustc_hir:: { self as hir, Attribute , HirId , MaybeOwner , Node , OwnerInfo , TraitCandidate } ;
3939use rustc_index:: IndexVec ;
4040use rustc_macros:: { HashStable , TyDecodable , TyEncodable } ;
4141use rustc_query_system:: cache:: WithDepNode ;
@@ -1282,23 +1282,24 @@ impl<'tcx> TyCtxtFeed<'tcx, LocalDefId> {
12821282
12831283 // Fills in all the important parts needed by HIR queries
12841284 pub fn feed_hir ( & self ) {
1285- self . local_def_id_to_hir_id ( HirId :: make_owner ( self . def_id ( ) ) ) ;
1286-
12871285 let node = hir:: OwnerNode :: Synthetic ;
12881286 let bodies = Default :: default ( ) ;
1289- let attrs = hir:: AttributeMap :: EMPTY ;
1290-
1287+ let attrs = hir:: AttributeMap :: empty ( ) ;
12911288 let ( opt_hash_including_bodies, _) = self . tcx . hash_owner_nodes ( node, & bodies, & attrs. map ) ;
12921289 let node = node. into ( ) ;
1293- self . opt_hir_owner_nodes ( Some ( self . tcx . arena . alloc ( hir:: OwnerNodes {
1294- opt_hash_including_bodies,
1295- nodes : IndexVec :: from_elem_n (
1296- hir:: ParentedNode { parent : hir:: ItemLocalId :: INVALID , node } ,
1297- 1 ,
1298- ) ,
1299- bodies,
1290+ self . hir_owner ( MaybeOwner :: Owner ( self . tcx . arena . alloc ( OwnerInfo {
1291+ nodes : hir:: OwnerNodes {
1292+ opt_hash_including_bodies,
1293+ nodes : IndexVec :: from_elem_n (
1294+ hir:: ParentedNode { parent : hir:: ItemLocalId :: INVALID , node } ,
1295+ 1 ,
1296+ ) ,
1297+ bodies,
1298+ } ,
1299+ parenting : Default :: default ( ) ,
1300+ attrs,
1301+ trait_map : Default :: default ( ) ,
13001302 } ) ) ) ;
1301- self . feed_owner_id ( ) . hir_attr_map ( attrs) ;
13021303 }
13031304}
13041305
0 commit comments