Skip to content

Commit d26917a

Browse files
committed
fix for latest rustc
1 parent 93e110f commit d26917a

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a45743345659c775b01484574af2818c46a2cb03
1+
11a51488f03405ea539a9fe84973ee972eaa7b96

src/shims/foreign_items.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,9 +655,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
655655
// This is `libc::pthread_key_t`.
656656
let key_type = args[0].layout.ty
657657
.builtin_deref(true)
658-
.ok_or_else(|| err_ub!(Ub(format!(
658+
.ok_or_else(|| err_ub_format!(
659659
"wrong signature used for `pthread_key_create`: first argument must be a raw pointer."
660-
))))?
660+
))?
661661
.ty;
662662
let key_layout = this.layout_of(key_type)?;
663663

src/shims/intrinsics.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
4444
"assume" => {
4545
let cond = this.read_scalar(args[0])?.to_bool()?;
4646
if !cond {
47-
throw_unsup!(AssumptionNotHeld);
47+
throw_ub_format!("`assume` intrinsic called with `false`");
4848
}
4949
}
5050

@@ -316,9 +316,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
316316
// Check if `b` is -1, which is the "min_value / -1" case.
317317
let minus1 = Scalar::from_int(-1, dest.layout.size);
318318
return Err(if b.to_scalar().unwrap() == minus1 {
319-
err_ub!(Ub(format!("exact_div: result of dividing MIN by -1 cannot be represented")))
319+
err_ub_format!("exact_div: result of dividing MIN by -1 cannot be represented")
320320
} else {
321-
err_ub!(Ub(format!("exact_div: {:?} cannot be divided by {:?} without remainder", *a, *b)))
321+
err_ub_format!("exact_div: {:?} cannot be divided by {:?} without remainder", *a, *b)
322322
}.into());
323323
}
324324
this.binop_ignore_overflow(mir::BinOp::Div, a, b, dest)?;

src/shims/tls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
158158
StackPopCleanup::None { cleanup: true },
159159
)?;
160160
let arg_local = this.frame().body.args_iter().next().ok_or_else(
161-
|| err_ub!(Ub(format!("TLS dtor does not take enough arguments."))),
161+
|| err_ub_format!("TLS dtor does not take enough arguments."),
162162
)?;
163163
let dest = this.local_place(arg_local)?;
164164
this.write_scalar(ptr, dest)?;

src/stacked_borrows.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

tests/compile-fail/assume.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ fn main() {
55
unsafe {
66
std::intrinsics::assume(x < 10);
77
std::intrinsics::assume(x > 1);
8-
std::intrinsics::assume(x > 42); //~ `assume` argument was false
8+
std::intrinsics::assume(x > 42); //~ `assume` intrinsic called with `false`
99
}
1010
}

0 commit comments

Comments
 (0)