We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
unsigned_offset_from
sub_ptr
1 parent 06817d1 commit bb7b844Copy full SHA for bb7b844
src/intrinsics/mod.rs
@@ -721,7 +721,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
721
let diff_bytes = fx.bcx.ins().isub(ptr, base);
722
// FIXME this can be an exact division.
723
let diff = if intrinsic == sym::ptr_offset_from_unsigned {
724
- // Because diff_bytes ULT isize::MAX, this would be fine as signed,
+ // Because diff_bytes ULE isize::MAX, this would be fine as signed,
725
// but unsigned is slightly easier to codegen, so might as well.
726
fx.bcx.ins().udiv_imm(diff_bytes, pointee_size as i64)
727
} else {
0 commit comments