Skip to content

Commit 67f6fa1

Browse files
committed
Work around 144661 by not giving function allocations alignment in consteval.
1 parent e5e79f8 commit 67f6fa1

File tree

1 file changed

+4
-2
lines changed
  • compiler/rustc_const_eval/src/interpret

1 file changed

+4
-2
lines changed

compiler/rustc_const_eval/src/interpret/memory.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -937,8 +937,10 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
937937
// (both global from `alloc_map` and local from `extra_fn_ptr_map`)
938938
if let Some(fn_val) = self.get_fn_alloc(id) {
939939
let align = match fn_val {
940-
FnVal::Instance(instance) => {
941-
self.tcx.codegen_instance_attrs(instance.def).alignment.unwrap_or(Align::ONE)
940+
FnVal::Instance(_instance) => {
941+
// FIXME: as a workaround for #144661, we ignore the alignment of functions for this purpose
942+
//self.tcx.codegen_instance_attrs(instance.def).alignment.unwrap_or(Align::ONE)
943+
Align::ONE
942944
}
943945
// Machine-specific extra functions currently do not support alignment restrictions.
944946
FnVal::Other(_) => Align::ONE,

0 commit comments

Comments
 (0)