11use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
22use rustc_index:: bit_set:: HybridBitSet ;
3+ use rustc_index:: interval:: IntervalSet ;
34use rustc_infer:: infer:: canonical:: QueryRegionConstraints ;
45use rustc_middle:: mir:: { BasicBlock , Body , ConstraintCategory , Local , Location } ;
56use rustc_middle:: ty:: { Ty , TypeFoldable } ;
@@ -105,12 +106,12 @@ struct LivenessResults<'me, 'typeck, 'flow, 'tcx> {
105106
106107 /// Points where the current variable is "use live" -- meaning
107108 /// that there is a future "full use" that may use its value.
108- use_live_at : HybridBitSet < PointIndex > ,
109+ use_live_at : IntervalSet < PointIndex > ,
109110
110111 /// Points where the current variable is "drop live" -- meaning
111112 /// that there is no future "full use" that may use its value, but
112113 /// there is a future drop.
113- drop_live_at : HybridBitSet < PointIndex > ,
114+ drop_live_at : IntervalSet < PointIndex > ,
114115
115116 /// Locations where drops may occur.
116117 drop_locations : Vec < Location > ,
@@ -125,8 +126,8 @@ impl<'me, 'typeck, 'flow, 'tcx> LivenessResults<'me, 'typeck, 'flow, 'tcx> {
125126 LivenessResults {
126127 cx,
127128 defs : HybridBitSet :: new_empty ( num_points) ,
128- use_live_at : HybridBitSet :: new_empty ( num_points) ,
129- drop_live_at : HybridBitSet :: new_empty ( num_points) ,
129+ use_live_at : IntervalSet :: new ( num_points) ,
130+ drop_live_at : IntervalSet :: new ( num_points) ,
130131 drop_locations : vec ! [ ] ,
131132 stack : vec ! [ ] ,
132133 }
@@ -165,7 +166,7 @@ impl<'me, 'typeck, 'flow, 'tcx> LivenessResults<'me, 'typeck, 'flow, 'tcx> {
165166 drop_used : Vec < ( Local , Location ) > ,
166167 live_locals : FxHashSet < Local > ,
167168 ) {
168- let locations = HybridBitSet :: new_empty ( self . cx . elements . num_points ( ) ) ;
169+ let locations = IntervalSet :: new ( self . cx . elements . num_points ( ) ) ;
169170
170171 for ( local, location) in drop_used {
171172 if !live_locals. contains ( & local) {
@@ -456,7 +457,7 @@ impl<'tcx> LivenessContext<'_, '_, '_, 'tcx> {
456457 fn add_use_live_facts_for (
457458 & mut self ,
458459 value : impl TypeFoldable < ' tcx > ,
459- live_at : & HybridBitSet < PointIndex > ,
460+ live_at : & IntervalSet < PointIndex > ,
460461 ) {
461462 debug ! ( "add_use_live_facts_for(value={:?})" , value) ;
462463
@@ -473,7 +474,7 @@ impl<'tcx> LivenessContext<'_, '_, '_, 'tcx> {
473474 dropped_local : Local ,
474475 dropped_ty : Ty < ' tcx > ,
475476 drop_locations : & [ Location ] ,
476- live_at : & HybridBitSet < PointIndex > ,
477+ live_at : & IntervalSet < PointIndex > ,
477478 ) {
478479 debug ! (
479480 "add_drop_live_constraint(\
@@ -521,7 +522,7 @@ impl<'tcx> LivenessContext<'_, '_, '_, 'tcx> {
521522 elements : & RegionValueElements ,
522523 typeck : & mut TypeChecker < ' _ , ' tcx > ,
523524 value : impl TypeFoldable < ' tcx > ,
524- live_at : & HybridBitSet < PointIndex > ,
525+ live_at : & IntervalSet < PointIndex > ,
525526 ) {
526527 debug ! ( "make_all_regions_live(value={:?})" , value) ;
527528 debug ! (
0 commit comments