@@ -289,14 +289,6 @@ pub(crate) enum UndoLog<'tcx> {
289
289
290
290
/// We added a GLB/LUB "combination variable".
291
291
AddCombination ( CombineMapType , TwoRegions < ' tcx > ) ,
292
-
293
- /// During freshening, we sometimes purge entries from the undo
294
- /// log in a kind of minisnapshot (unlike other snapshots, this
295
- /// purging actually takes place *on success*). In that case, we
296
- /// replace the corresponding entry with `Noop` so as to avoid the
297
- /// need to do a bunch of swapping. (We can't use `swap_remove` as
298
- /// the order of the vector is important.)
299
- Purged ,
300
292
}
301
293
302
294
#[ derive( Copy , Clone , PartialEq ) ]
@@ -357,9 +349,6 @@ impl<'tcx> RegionConstraintStorage<'tcx> {
357
349
358
350
fn rollback_undo_entry ( & mut self , undo_entry : UndoLog < ' tcx > ) {
359
351
match undo_entry {
360
- Purged => {
361
- // nothing to do here
362
- }
363
352
AddVar ( vid) => {
364
353
self . var_infos . pop ( ) . unwrap ( ) ;
365
354
assert_eq ! ( self . var_infos. len( ) , vid. index( ) as usize ) ;
@@ -488,62 +477,6 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
488
477
self . var_infos [ vid] . origin
489
478
}
490
479
491
- /// Removes all the edges to/from the placeholder regions that are
492
- /// in `placeholders`. This is used after a higher-ranked operation
493
- /// completes to remove all trace of the placeholder regions
494
- /// created in that time.
495
- pub fn pop_placeholders ( & mut self , placeholders : & FxHashSet < ty:: Region < ' tcx > > ) {
496
- debug ! ( "pop_placeholders(placeholders={:?})" , placeholders) ;
497
-
498
- assert ! ( UndoLogs :: <super :: UndoLog <' _>>:: in_snapshot( & self . undo_log) ) ;
499
-
500
- let constraints_to_kill: Vec < usize > = self
501
- . undo_log
502
- . iter ( )
503
- . enumerate ( )
504
- . rev ( )
505
- . filter ( |& ( _, undo_entry) | match undo_entry {
506
- super :: UndoLog :: RegionConstraintCollector ( undo_entry) => {
507
- kill_constraint ( placeholders, undo_entry)
508
- }
509
- _ => false ,
510
- } )
511
- . map ( |( index, _) | index)
512
- . collect ( ) ;
513
-
514
- for index in constraints_to_kill {
515
- let undo_entry = match & mut self . undo_log [ index] {
516
- super :: UndoLog :: RegionConstraintCollector ( undo_entry) => {
517
- mem:: replace ( undo_entry, Purged )
518
- }
519
- _ => unreachable ! ( ) ,
520
- } ;
521
- self . rollback_undo_entry ( undo_entry) ;
522
- }
523
-
524
- return ;
525
-
526
- fn kill_constraint < ' tcx > (
527
- placeholders : & FxHashSet < ty:: Region < ' tcx > > ,
528
- undo_entry : & UndoLog < ' tcx > ,
529
- ) -> bool {
530
- match undo_entry {
531
- & AddConstraint ( Constraint :: VarSubVar ( ..) ) => false ,
532
- & AddConstraint ( Constraint :: RegSubVar ( a, _) ) => placeholders. contains ( & a) ,
533
- & AddConstraint ( Constraint :: VarSubReg ( _, b) ) => placeholders. contains ( & b) ,
534
- & AddConstraint ( Constraint :: RegSubReg ( a, b) ) => {
535
- placeholders. contains ( & a) || placeholders. contains ( & b)
536
- }
537
- & AddGiven ( ..) => false ,
538
- & AddVerify ( _) => false ,
539
- & AddCombination ( _, ref two_regions) => {
540
- placeholders. contains ( & two_regions. a ) || placeholders. contains ( & two_regions. b )
541
- }
542
- & AddVar ( ..) | & Purged => false ,
543
- }
544
- }
545
- }
546
-
547
480
fn add_constraint ( & mut self , constraint : Constraint < ' tcx > , origin : SubregionOrigin < ' tcx > ) {
548
481
// cannot add constraints once regions are resolved
549
482
debug ! ( "RegionConstraintCollector: add_constraint({:?})" , constraint) ;
0 commit comments