Skip to content

Commit beed5ed

Browse files
committed
Auto merge of #2539 - oli-obk:rustup, r=oli-obk
Rustup for rust-lang/rust#101649
2 parents ef3f649 + e91db9f commit beed5ed

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

rust-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
e7c7aa7288559f8e5ea7ce3543ff946b09783628
1+
5197c96c49fc3b7de3ce9a31f7cc62d2cbd1f70c

src/shims/intrinsics/mod.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
7575

7676
match intrinsic_name {
7777
// Miri overwriting CTFE intrinsics.
78-
"ptr_guaranteed_eq" => {
78+
"ptr_guaranteed_cmp" => {
7979
let [left, right] = check_arg_count(args)?;
8080
let left = this.read_immediate(left)?;
8181
let right = this.read_immediate(right)?;
82-
this.binop_ignore_overflow(mir::BinOp::Eq, &left, &right, dest)?;
83-
}
84-
"ptr_guaranteed_ne" => {
85-
let [left, right] = check_arg_count(args)?;
86-
let left = this.read_immediate(left)?;
87-
let right = this.read_immediate(right)?;
88-
this.binop_ignore_overflow(mir::BinOp::Ne, &left, &right, dest)?;
82+
let (val, _overflowed, _ty) =
83+
this.overflowing_binary_op(mir::BinOp::Eq, &left, &right)?;
84+
// We're type punning a bool as an u8 here.
85+
this.write_scalar(val, dest)?;
8986
}
9087
"const_allocate" => {
9188
// For now, for compatibility with the run-time implementation of this, we just return null.

tests/pass/pointers.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ fn main() {
135135
// CTFE-specific equality tests, need to also work at runtime.
136136
let addr = &13 as *const i32;
137137
let addr2 = (addr as usize).wrapping_add(usize::MAX).wrapping_add(1);
138-
assert!(addr.guaranteed_eq(addr2 as *const _));
139-
assert!(addr.guaranteed_ne(0x100 as *const _));
138+
assert_eq!(addr.guaranteed_eq(addr2 as *const _), Some(true));
139+
assert_eq!(addr.guaranteed_ne(0x100 as *const _), Some(true));
140140

141141
wide_ptr_ops();
142142
metadata_vtable();

0 commit comments

Comments
 (0)