about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa/mir
diff options
context:
space:
mode:
authorAmanieu d'Antras <amanieu@gmail.com>2020-05-24 02:04:49 +0100
committerAmanieu d'Antras <amanieu@gmail.com>2020-05-24 02:04:49 +0100
commit3ed1e79cc40133b6cdb65955c7433cc483a89ca8 (patch)
tree26209bd7f48deaf082b0d1dcd25b8a43d7f095c6 /src/librustc_codegen_ssa/mir
parent215f2d3294b08dbdcf8f7d40de21ef1e7eae0a2d (diff)
downloadrust-3ed1e79cc40133b6cdb65955c7433cc483a89ca8.tar.gz
rust-3ed1e79cc40133b6cdb65955c7433cc483a89ca8.zip
Properly handle InlineAsmOperand::SymFn when collecting monomorphized items
Fixes #72484
Diffstat (limited to 'src/librustc_codegen_ssa/mir')
-rw-r--r--src/librustc_codegen_ssa/mir/block.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/librustc_codegen_ssa/mir/block.rs b/src/librustc_codegen_ssa/mir/block.rs
index b487ed8dea8..2a6d1abba9e 100644
--- a/src/librustc_codegen_ssa/mir/block.rs
+++ b/src/librustc_codegen_ssa/mir/block.rs
@@ -908,13 +908,12 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
                 mir::InlineAsmOperand::SymFn { ref value } => {
                     let literal = self.monomorphize(&value.literal);
                     if let ty::FnDef(def_id, substs) = literal.ty.kind {
-                        let instance = ty::Instance::resolve(
+                        let instance = ty::Instance::resolve_for_fn_ptr(
                             bx.tcx(),
                             ty::ParamEnv::reveal_all(),
                             def_id,
                             substs,
                         )
-                        .unwrap()
                         .unwrap();
                         InlineAsmOperandRef::SymFn { instance }
                     } else {