about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-09-10 09:50:21 +0000
committerbors <bors@rust-lang.org>2022-09-10 09:50:21 +0000
commit16ed1913622e5c10ce7630a2dc23ab6010a02197 (patch)
tree8c8cd3c6cbe0a5797927b6dc16dad9ce68cfe963
parent944a142bfae7ee0d10cb12e9c3383b05e311f57e (diff)
parent931c07c94f5e6d2e24c08a1c4941612aab69872a (diff)
downloadrust-16ed1913622e5c10ce7630a2dc23ab6010a02197.tar.gz
rust-16ed1913622e5c10ce7630a2dc23ab6010a02197.zip
Auto merge of #101483 - oli-obk:guaranteed_opt, r=fee1-dead
The `<*const T>::guaranteed_*` methods now return an option for the unknown case

cc https://github.com/rust-lang/rust/issues/53020#issuecomment-1236932443

I chose `0` for "not equal" and `1` for "equal" and left `2` for the unknown case so backends can just forward to raw pointer equality and it works ✨

r? `@fee1-dead` or `@lcnr`

cc `@rust-lang/wg-const-eval`
-rw-r--r--src/intrinsics/mod.rs9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/intrinsics/mod.rs b/src/intrinsics/mod.rs
index 0cd9332a58b..2e4ca594f91 100644
--- a/src/intrinsics/mod.rs
+++ b/src/intrinsics/mod.rs
@@ -816,20 +816,13 @@ fn codegen_regular_intrinsic_call<'tcx>(
             ret.write_cvalue(fx, val);
         }
 
-        sym::ptr_guaranteed_eq => {
+        sym::ptr_guaranteed_cmp => {
             intrinsic_args!(fx, args => (a, b); intrinsic);
 
             let val = crate::num::codegen_ptr_binop(fx, BinOp::Eq, a, b);
             ret.write_cvalue(fx, val);
         }
 
-        sym::ptr_guaranteed_ne => {
-            intrinsic_args!(fx, args => (a, b); intrinsic);
-
-            let val = crate::num::codegen_ptr_binop(fx, BinOp::Ne, a, b);
-            ret.write_cvalue(fx, val);
-        }
-
         sym::caller_location => {
             intrinsic_args!(fx, args => (); intrinsic);