Skip to content

Commit 7b2a5f2

Browse files
committed
dont rely on old macro-in-trait-impl bug
1 parent be6bb56 commit 7b2a5f2

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

compiler/rustc_const_eval/src/interpret/machine.rs

-12
Original file line numberDiff line numberDiff line change
@@ -436,24 +436,12 @@ pub macro compile_time_machine(<$mir: lifetime, $tcx: lifetime>) {
436436
type AllocExtra = ();
437437
type FrameExtra = ();
438438

439-
#[inline(always)]
440-
fn enforce_alignment(_ecx: &InterpCx<$mir, $tcx, Self>) -> bool {
441-
// We do not check for alignment to avoid having to carry an `Align`
442-
// in `ConstValue::ByRef`.
443-
false
444-
}
445-
446439
#[inline(always)]
447440
fn force_int_for_alignment_check(_ecx: &InterpCx<$mir, $tcx, Self>) -> bool {
448441
// We do not support `force_int`.
449442
false
450443
}
451444

452-
#[inline(always)]
453-
fn enforce_validity(_ecx: &InterpCx<$mir, $tcx, Self>) -> bool {
454-
false // for now, we don't enforce validity
455-
}
456-
457445
#[inline(always)]
458446
fn enforce_number_init(_ecx: &InterpCx<$mir, $tcx, Self>) -> bool {
459447
true

compiler/rustc_mir_transform/src/const_prop.rs

+12
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,18 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for ConstPropMachine<'mir, 'tcx>
183183

184184
type MemoryKind = !;
185185

186+
#[inline(always)]
187+
fn enforce_alignment(_ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {
188+
// We do not check for alignment to avoid having to carry an `Align`
189+
// in `ConstValue::ByRef`.
190+
false
191+
}
192+
193+
#[inline(always)]
194+
fn enforce_validity(_ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {
195+
false // for now, we don't enforce validity
196+
}
197+
186198
fn load_mir(
187199
_ecx: &InterpCx<'mir, 'tcx, Self>,
188200
_instance: ty::InstanceDef<'tcx>,

0 commit comments

Comments
 (0)