@@ -37,7 +37,7 @@ use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE, LocalDefId};
3737use rustc_hir:: definitions:: { DefPathData , Definitions , DisambiguatorState } ;
3838use rustc_hir:: intravisit:: VisitorExt ;
3939use 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 } ;
4141use rustc_index:: IndexVec ;
4242use rustc_macros:: { HashStable , TyDecodable , TyEncodable } ;
4343use rustc_query_system:: cache:: WithDepNode ;
@@ -1329,24 +1329,25 @@ impl<'tcx> TyCtxtFeed<'tcx, LocalDefId> {
13291329
13301330 // Fills in all the important parts needed by HIR queries
13311331 pub fn feed_hir ( & self ) {
1332- self . local_def_id_to_hir_id ( HirId :: make_owner ( self . def_id ( ) ) ) ;
1333-
13341332 let node = hir:: OwnerNode :: Synthetic ;
13351333 let bodies = Default :: default ( ) ;
1336- let attrs = hir:: AttributeMap :: EMPTY ;
1337-
1334+ let attrs = hir:: AttributeMap :: empty ( ) ;
13381335 let ( opt_hash_including_bodies, _) =
13391336 self . tcx . hash_owner_nodes ( node, & bodies, & attrs. map , attrs. define_opaque ) ;
13401337 let node = node. into ( ) ;
1341- self . opt_hir_owner_nodes ( Some ( self . tcx . arena . alloc ( 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,
1338+ self . hir_owner ( MaybeOwner :: Owner ( self . tcx . arena . alloc ( OwnerInfo {
1339+ nodes : hir:: OwnerNodes {
1340+ opt_hash_including_bodies,
1341+ nodes : IndexVec :: from_elem_n (
1342+ hir:: ParentedNode { parent : hir:: ItemLocalId :: INVALID , node } ,
1343+ 1 ,
1344+ ) ,
1345+ bodies,
1346+ } ,
1347+ parenting : Default :: default ( ) ,
1348+ attrs,
1349+ trait_map : Default :: default ( ) ,
13481350 } ) ) ) ;
1349- self . feed_owner_id ( ) . hir_attr_map ( attrs) ;
13501351 }
13511352}
13521353
0 commit comments