@@ -273,14 +273,14 @@ impl<'tcx> Stack {
273273 if let Some ( call) = item. protector {
274274 if global. is_active ( call) {
275275 if let Some ( tag) = tag {
276- throw_ub_format ! (
276+ throw_ub ! ( UbExperimental ( format !(
277277 "not granting access to tag {:?} because incompatible item is protected: {:?}" ,
278278 tag, item
279- ) ;
279+ ) ) ) ;
280280 } else {
281- throw_ub_format ! (
281+ throw_ub ! ( UbExperimental ( format !(
282282 "deallocating while item is protected: {:?}" , item
283- ) ;
283+ ) ) ) ;
284284 }
285285 }
286286 }
@@ -299,7 +299,7 @@ impl<'tcx> Stack {
299299
300300 // Step 1: Find granting item.
301301 let granting_idx = self . find_granting ( access, tag)
302- . ok_or_else ( || err_ub ! ( Ub ( format!(
302+ . ok_or_else ( || err_ub ! ( UbExperimental ( format!(
303303 "no item granting {} to tag {:?} found in borrow stack" ,
304304 access, tag,
305305 ) ) ) ) ?;
@@ -346,7 +346,7 @@ impl<'tcx> Stack {
346346 ) -> InterpResult < ' tcx > {
347347 // Step 1: Find granting item.
348348 self . find_granting ( AccessKind :: Write , tag)
349- . ok_or_else ( || err_ub ! ( Ub ( format!(
349+ . ok_or_else ( || err_ub ! ( UbExperimental ( format!(
350350 "no item granting write access for deallocation to tag {:?} found in borrow stack" ,
351351 tag,
352352 ) ) ) ) ?;
@@ -378,7 +378,7 @@ impl<'tcx> Stack {
378378 // Now we figure out which item grants our parent (`derived_from`) this kind of access.
379379 // We use that to determine where to put the new item.
380380 let granting_idx = self . find_granting ( access, derived_from)
381- . ok_or_else ( || err_ub ! ( Ub ( format!(
381+ . ok_or_else ( || err_ub ! ( UbExperimental ( format!(
382382 "trying to reborrow for {:?}, but parent tag {:?} does not have an appropriate item in the borrow stack" , new. perm, derived_from,
383383 ) ) ) ) ?;
384384
0 commit comments