Skip to content

Commit 9d604f3

Browse files
committed
fix an outdated machine hook name
1 parent 983f4da commit 9d604f3

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

compiler/rustc_const_eval/src/interpret/machine.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ pub trait Machine<'mir, 'tcx>: Sized {
123123
/// Whether memory accesses should be alignment-checked.
124124
fn enforce_alignment(ecx: &InterpCx<'mir, 'tcx, Self>) -> bool;
125125

126-
/// Whether, when checking alignment, we should `force_int` and thus support
126+
/// Whether, when checking alignment, we should look at the actual address and thus support
127127
/// custom alignment logic based on whatever the integer address happens to be.
128128
///
129-
/// Requires Provenance::OFFSET_IS_ADDR to be true.
130-
fn force_int_for_alignment_check(ecx: &InterpCx<'mir, 'tcx, Self>) -> bool;
129+
/// If this returns true, Provenance::OFFSET_IS_ADDR must be true.
130+
fn use_addr_for_alignment_check(ecx: &InterpCx<'mir, 'tcx, Self>) -> bool;
131131

132132
/// Whether to enforce the validity invariant
133133
fn enforce_validity(ecx: &InterpCx<'mir, 'tcx, Self>) -> bool;
@@ -437,8 +437,8 @@ pub macro compile_time_machine(<$mir: lifetime, $tcx: lifetime>) {
437437
type FrameExtra = ();
438438

439439
#[inline(always)]
440-
fn force_int_for_alignment_check(_ecx: &InterpCx<$mir, $tcx, Self>) -> bool {
441-
// We do not support `force_int`.
440+
fn use_addr_for_alignment_check(_ecx: &InterpCx<$mir, $tcx, Self>) -> bool {
441+
// We do not support `use_addr`.
442442
false
443443
}
444444

compiler/rustc_const_eval/src/interpret/memory.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
445445
// Test align. Check this last; if both bounds and alignment are violated
446446
// we want the error to be about the bounds.
447447
if let Some(align) = align {
448-
if M::force_int_for_alignment_check(self) {
449-
// `force_int_for_alignment_check` can only be true if `OFFSET_IS_ADDR` is true.
448+
if M::use_addr_for_alignment_check(self) {
449+
// `use_addr_for_alignment_check` can only be true if `OFFSET_IS_ADDR` is true.
450450
check_offset_align(ptr.addr().bytes(), align)?;
451451
} else {
452452
// Check allocation alignment and offset alignment.

0 commit comments

Comments
 (0)