-a45743345659c775b01484574af2818c46a2cb03
+11a51488f03405ea539a9fe84973ee972eaa7b96
// This is `libc::pthread_key_t`.
let key_type = args[0].layout.ty
.builtin_deref(true)
- .ok_or_else(|| err_ub!(Ub(format!(
+ .ok_or_else(|| err_ub_format!(
"wrong signature used for `pthread_key_create`: first argument must be a raw pointer."
- ))))?
+ ))?
.ty;
let key_layout = this.layout_of(key_type)?;
"assume" => {
let cond = this.read_scalar(args[0])?.to_bool()?;
if !cond {
- throw_unsup!(AssumptionNotHeld);
+ throw_ub_format!("`assume` intrinsic called with `false`");
}
}
// Check if `b` is -1, which is the "min_value / -1" case.
let minus1 = Scalar::from_int(-1, dest.layout.size);
return Err(if b.to_scalar().unwrap() == minus1 {
- err_ub!(Ub(format!("exact_div: result of dividing MIN by -1 cannot be represented")))
+ err_ub_format!("exact_div: result of dividing MIN by -1 cannot be represented")
} else {
- err_ub!(Ub(format!("exact_div: {:?} cannot be divided by {:?} without remainder", *a, *b)))
+ err_ub_format!("exact_div: {:?} cannot be divided by {:?} without remainder", *a, *b)
}.into());
}
this.binop_ignore_overflow(mir::BinOp::Div, a, b, dest)?;
StackPopCleanup::None { cleanup: true },
)?;
let arg_local = this.frame().body.args_iter().next().ok_or_else(
- || err_ub!(Ub(format!("TLS dtor does not take enough arguments."))),
+ || err_ub_format!("TLS dtor does not take enough arguments."),
)?;
let dest = this.local_place(arg_local)?;
this.write_scalar(ptr, dest)?;
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
- );
+ )));
}
}
}
// 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,
))))?;
) -> 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,
))))?;
// 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,
))))?;
unsafe {
std::intrinsics::assume(x < 10);
std::intrinsics::assume(x > 1);
- std::intrinsics::assume(x > 42); //~ `assume` argument was false
+ std::intrinsics::assume(x > 42); //~ `assume` intrinsic called with `false`
}
}