@@ -96,6 +96,8 @@ struct LoweringContext<'a, 'hir> {
9696
9797 /// Bodies inside the owner being lowered.
9898 bodies : Vec < ( hir:: ItemLocalId , & ' hir hir:: Body < ' hir > ) > ,
99+ /// Whether there were inline consts that typeck will split out into bodies
100+ has_inline_consts : bool ,
99101 /// Attributes inside the owner being lowered.
100102 attrs : SortedMap < hir:: ItemLocalId , & ' hir [ Attribute ] > ,
101103 /// Collect items that were created by lowering the current owner.
@@ -158,6 +160,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
158160 item_local_id_counter : hir:: ItemLocalId :: ZERO ,
159161 node_id_to_local_id : Default :: default ( ) ,
160162 trait_map : Default :: default ( ) ,
163+ has_inline_consts : false ,
161164
162165 // Lowering state.
163166 catch_scope : None ,
@@ -567,6 +570,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
567570
568571 let current_attrs = std:: mem:: take ( & mut self . attrs ) ;
569572 let current_bodies = std:: mem:: take ( & mut self . bodies ) ;
573+ let current_has_inline_consts = std:: mem:: take ( & mut self . has_inline_consts ) ;
570574 let current_node_ids = std:: mem:: take ( & mut self . node_id_to_local_id ) ;
571575 let current_trait_map = std:: mem:: take ( & mut self . trait_map ) ;
572576 let current_owner =
@@ -593,6 +597,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
593597
594598 self . attrs = current_attrs;
595599 self . bodies = current_bodies;
600+ self . has_inline_consts = current_has_inline_consts;
596601 self . node_id_to_local_id = current_node_ids;
597602 self . trait_map = current_trait_map;
598603 self . current_hir_id_owner = current_owner;
@@ -629,6 +634,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
629634 let attrs = std:: mem:: take ( & mut self . attrs ) ;
630635 let mut bodies = std:: mem:: take ( & mut self . bodies ) ;
631636 let trait_map = std:: mem:: take ( & mut self . trait_map ) ;
637+ let has_inline_consts = std:: mem:: take ( & mut self . has_inline_consts ) ;
632638
633639 #[ cfg( debug_assertions) ]
634640 for ( id, attrs) in attrs. iter ( ) {
@@ -646,7 +652,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
646652 self . tcx . hash_owner_nodes ( node, & bodies, & attrs) ;
647653 let num_nodes = self . item_local_id_counter . as_usize ( ) ;
648654 let ( nodes, parenting) = index:: index_hir ( self . tcx , node, & bodies, num_nodes) ;
649- let nodes = hir:: OwnerNodes { opt_hash_including_bodies, nodes, bodies } ;
655+ let nodes = hir:: OwnerNodes { opt_hash_including_bodies, nodes, bodies, has_inline_consts } ;
650656 let attrs = hir:: AttributeMap { map : attrs, opt_hash : attrs_hash } ;
651657
652658 self . arena . alloc ( hir:: OwnerInfo { nodes, parenting, attrs, trait_map } )
0 commit comments