Skip to content

Commit 0c7d5e2

Browse files
committed
Convert more missed places
1 parent 854948a commit 0c7d5e2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/tools/miri/src/intrinsics/atomic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ trait EvalContextPrivExt<'tcx>: MiriInterpCxExt<'tcx> {
189189
let place = this.deref_pointer(place)?;
190190
let rhs = this.read_immediate(rhs)?;
191191

192-
if !place.layout.ty.is_integral() && !place.layout.ty.is_unsafe_ptr() {
192+
if !place.layout.ty.is_integral() && !place.layout.ty.is_raw_ptr() {
193193
span_bug!(
194194
this.cur_span(),
195195
"atomic arithmetic operations only work on integer and raw pointer types",

src/tools/miri/src/operator.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
5252
// Some more operations are possible with atomics.
5353
// The return value always has the provenance of the *left* operand.
5454
Add | Sub | BitOr | BitAnd | BitXor => {
55-
assert!(left.layout.ty.is_unsafe_ptr());
56-
assert!(right.layout.ty.is_unsafe_ptr());
55+
assert!(left.layout.ty.is_raw_ptr());
56+
assert!(right.layout.ty.is_raw_ptr());
5757
let ptr = left.to_scalar().to_pointer(this)?;
5858
// We do the actual operation with usize-typed scalars.
5959
let left = ImmTy::from_uint(ptr.addr().bytes(), this.machine.layouts.usize);

0 commit comments

Comments
 (0)