]> git.lizzy.rs Git - rust.git/commitdiff
region_constraints: only push givens into undo-log if in a snapshot
authorNiko Matsakis <niko@alum.mit.edu>
Sun, 5 Nov 2017 23:46:37 +0000 (18:46 -0500)
committerNiko Matsakis <niko@alum.mit.edu>
Thu, 16 Nov 2017 10:57:44 +0000 (05:57 -0500)
src/librustc/infer/region_constraints/mod.rs

index 634e4642600681bedf7a396653c2801c8fc6551d..749a47004da311ce238fe1ff3ab851e940e50730 100644 (file)
@@ -562,7 +562,9 @@ pub fn add_given(&mut self, sub: Region<'tcx>, sup: ty::RegionVid) {
         if self.data.givens.insert((sub, sup)) {
             debug!("add_given({:?} <= {:?})", sub, sup);
 
-            self.undo_log.push(AddGiven(sub, sup));
+            if self.in_snapshot() {
+                self.undo_log.push(AddGiven(sub, sup));
+            }
         }
     }