Skip to content

Commit 16ed191

Browse files
committed
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 rust-lang/rust#53020 (comment) 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`
2 parents 944a142 + 931c07c commit 16ed191

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/intrinsics/mod.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -816,20 +816,13 @@ fn codegen_regular_intrinsic_call<'tcx>(
816816
ret.write_cvalue(fx, val);
817817
}
818818

819-
sym::ptr_guaranteed_eq => {
819+
sym::ptr_guaranteed_cmp => {
820820
intrinsic_args!(fx, args => (a, b); intrinsic);
821821

822822
let val = crate::num::codegen_ptr_binop(fx, BinOp::Eq, a, b);
823823
ret.write_cvalue(fx, val);
824824
}
825825

826-
sym::ptr_guaranteed_ne => {
827-
intrinsic_args!(fx, args => (a, b); intrinsic);
828-
829-
let val = crate::num::codegen_ptr_binop(fx, BinOp::Ne, a, b);
830-
ret.write_cvalue(fx, val);
831-
}
832-
833826
sym::caller_location => {
834827
intrinsic_args!(fx, args => (); intrinsic);
835828

0 commit comments

Comments
 (0)