Skip to content

Commit 1745f12

Browse files
committed
monomorphize type given to SymFn
1 parent e366108 commit 1745f12

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

compiler/rustc_codegen_ssa/src/mir/naked_asm.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,13 @@ fn inline_to_global_operand<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
6565
GlobalAsmOperandRef::Const { string }
6666
}
6767
InlineAsmOperand::SymFn { value } => {
68-
let instance = match value.ty().kind() {
68+
let mono_type = instance.instantiate_mir_and_normalize_erasing_regions(
69+
cx.tcx(),
70+
ty::ParamEnv::reveal_all(),
71+
ty::EarlyBinder::bind(value.ty()),
72+
);
73+
74+
let instance = match mono_type.kind() {
6975
&ty::FnDef(def_id, args) => Instance::new(def_id, args),
7076
_ => bug!("asm sym is not a function"),
7177
};

0 commit comments

Comments
 (0)