]> git.lizzy.rs Git - rust.git/blobdiff - src/stacked_borrows.rs
fix for latest rustc
[rust.git] / src / stacked_borrows.rs
index 0fbc3e1ac281df374c300970d6eb34d070d97aa0..01ed6ec225d204c23ad03ab0e3df18d2e0b63813 100644 (file)
@@ -273,14 +273,14 @@ fn check_protector(item: &Item, tag: Option<Tag>, global: &GlobalState) -> Inter
         if let Some(call) = item.protector {
             if global.is_active(call) {
                 if let Some(tag) = tag {
-                    throw_ub_format!(
+                    throw_ub!(UbExperimental(format!(
                         "not granting access to tag {:?} because incompatible item is protected: {:?}",
                         tag, item
-                    );
+                    )));
                 } else {
-                    throw_ub_format!(
+                    throw_ub!(UbExperimental(format!(
                         "deallocating while item is protected: {:?}", item
-                    );
+                    )));
                 }
             }
         }
@@ -299,7 +299,7 @@ fn access(
 
         // Step 1: Find granting item.
         let granting_idx = self.find_granting(access, tag)
-            .ok_or_else(|| err_ub!(Ub(format!(
+            .ok_or_else(|| err_ub!(UbExperimental(format!(
                 "no item granting {} to tag {:?} found in borrow stack",
                 access, tag,
             ))))?;
@@ -346,7 +346,7 @@ fn dealloc(
     ) -> InterpResult<'tcx> {
         // Step 1: Find granting item.
         self.find_granting(AccessKind::Write, tag)
-            .ok_or_else(|| err_ub!(Ub(format!(
+            .ok_or_else(|| err_ub!(UbExperimental(format!(
                 "no item granting write access for deallocation to tag {:?} found in borrow stack",
                 tag,
             ))))?;
@@ -378,7 +378,7 @@ fn grant(
         // Now we figure out which item grants our parent (`derived_from`) this kind of access.
         // We use that to determine where to put the new item.
         let granting_idx = self.find_granting(access, derived_from)
-            .ok_or_else(|| err_ub!(Ub(format!(
+            .ok_or_else(|| err_ub!(UbExperimental(format!(
                 "trying to reborrow for {:?}, but parent tag {:?} does not have an appropriate item in the borrow stack", new.perm, derived_from,
             ))))?;