Resolve instance for SymFn in global/naked asm
This commit is contained in:
@@ -457,7 +457,13 @@ where
|
||||
rustc_hir::InlineAsmOperand::SymFn { expr } => {
|
||||
let ty = cx.tcx().typeck(item_id.owner_id).expr_ty(expr);
|
||||
let instance = match ty.kind() {
|
||||
&ty::FnDef(def_id, args) => Instance::new(def_id, args),
|
||||
&ty::FnDef(def_id, args) => Instance::expect_resolve(
|
||||
cx.tcx(),
|
||||
ty::TypingEnv::fully_monomorphized(),
|
||||
def_id,
|
||||
args,
|
||||
expr.span,
|
||||
),
|
||||
_ => span_bug!(*op_sp, "asm sym is not a function"),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user