@@ -672,7 +672,7 @@ struct MirUsedCollector<'a, 'tcx> {
672672 visiting_call_terminator : bool ,
673673 /// Set of functions for which it is OK to move large data into.
674674 skip_move_check_fns : Option < Vec < DefId > > ,
675- reachable_blocks : Option < & ' tcx BitSet < mir:: BasicBlock > > ,
675+ reachable_blocks : Option < BitSet < mir:: BasicBlock > > ,
676676}
677677
678678impl < ' a , ' tcx > MirUsedCollector < ' a , ' tcx > {
@@ -836,6 +836,7 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirUsedCollector<'a, 'tcx> {
836836 fn visit_basic_block_data ( & mut self , block : mir:: BasicBlock , data : & mir:: BasicBlockData < ' tcx > ) {
837837 if self
838838 . reachable_blocks
839+ . as_ref ( )
839840 . expect ( "we should only walk blocks with CollectionMode::UsedItems" )
840841 . contains ( block)
841842 {
@@ -1414,6 +1415,7 @@ fn collect_items_of_instance<'tcx>(
14141415 // added to `used_items` in a hash set, which can efficiently query in the
14151416 // `body.mentioned_items` loop below without even having to monomorphize the item.
14161417 let mut used_mentioned_items = FxHashSet :: < MentionedItem < ' tcx > > :: default ( ) ;
1418+
14171419 let mut collector = MirUsedCollector {
14181420 tcx,
14191421 body,
@@ -1424,7 +1426,7 @@ fn collect_items_of_instance<'tcx>(
14241426 visiting_call_terminator : false ,
14251427 skip_move_check_fns : None ,
14261428 reachable_blocks : if mode == CollectionMode :: UsedItems {
1427- Some ( tcx . reachable_blocks ( instance) )
1429+ Some ( rustc_middle :: mir :: traversal :: reachable_blocks ( tcx , instance) )
14281430 } else {
14291431 None
14301432 } ,
0 commit comments