Skip to content

Commit e4e4f37

Browse files
committed
monomorphize type given to Const
1 parent 2316d4c commit e4e4f37

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

compiler/rustc_codegen_ssa/src/mir/naked_asm.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,20 @@ fn inline_to_global_operand<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
5656
)
5757
.eval(cx.tcx(), ty::ParamEnv::reveal_all(), value.span)
5858
.expect("erroneous constant missed by mono item collection");
59+
60+
let mono_type = instance.instantiate_mir_and_normalize_erasing_regions(
61+
cx.tcx(),
62+
ty::ParamEnv::reveal_all(),
63+
ty::EarlyBinder::bind(value.ty()),
64+
);
65+
5966
let string = common::asm_const_to_str(
6067
cx.tcx(),
6168
value.span,
6269
const_value,
63-
cx.layout_of(value.ty()),
70+
cx.layout_of(mono_type),
6471
);
72+
6573
GlobalAsmOperandRef::Const { string }
6674
}
6775
InlineAsmOperand::SymFn { value } => {

0 commit comments

Comments
 (0)