File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
compiler/rustc_infer/src/infer Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,7 @@ impl<'tcx> InferCtxt<'tcx> {
166166
167167 /// Trait queries just want to pass back type obligations "as is"
168168 pub fn take_registered_region_obligations ( & self ) -> Vec < TypeOutlivesConstraint < ' tcx > > {
169+ assert ! ( !self . in_snapshot( ) , "cannot take registered region obligations in a snapshot" ) ;
169170 std:: mem:: take ( & mut self . inner . borrow_mut ( ) . region_obligations )
170171 }
171172
Original file line number Diff line number Diff line change 1+ use std:: assert_matches:: assert_matches;
12use std:: marker:: PhantomData ;
23
34use rustc_data_structures:: undo_log:: { Rollback , UndoLogs } ;
@@ -73,7 +74,8 @@ impl<'tcx> Rollback<UndoLog<'tcx>> for InferCtxtInner<'tcx> {
7374 }
7475 UndoLog :: ProjectionCache ( undo) => self . projection_cache . reverse ( undo) ,
7576 UndoLog :: PushTypeOutlivesConstraint => {
76- self . region_obligations . pop ( ) ;
77+ let popped = self . region_obligations . pop ( ) ;
78+ assert_matches ! ( popped, Some ( _) , "pushed region constraint but could not pop it" ) ;
7779 }
7880 }
7981 }
You can’t perform that action at this time.
0 commit comments