Skip to content

Commit e4bde05

Browse files
Give Instance::expect_resolve a span
1 parent 5adaed0 commit e4bde05

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/abi/mod.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,14 @@ pub(crate) fn codegen_terminator_call<'tcx>(
371371

372372
// Handle special calls like intrinsics and empty drop glue.
373373
let instance = if let ty::FnDef(def_id, fn_args) = *func.layout().ty.kind() {
374-
let instance =
375-
ty::Instance::expect_resolve(fx.tcx, ty::ParamEnv::reveal_all(), def_id, fn_args)
376-
.polymorphize(fx.tcx);
374+
let instance = ty::Instance::expect_resolve(
375+
fx.tcx,
376+
ty::ParamEnv::reveal_all(),
377+
def_id,
378+
fn_args,
379+
Some(source_info.span),
380+
)
381+
.polymorphize(fx.tcx);
377382

378383
if is_call_from_compiler_builtins_to_upstream_monomorphization(fx.tcx, instance) {
379384
if target.is_some() {

src/main_shim.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ pub(crate) fn maybe_create_entry_wrapper(
119119
ParamEnv::reveal_all(),
120120
report.def_id,
121121
tcx.mk_args(&[GenericArg::from(main_ret_ty)]),
122+
None,
122123
)
123124
.polymorphize(tcx);
124125

@@ -144,6 +145,7 @@ pub(crate) fn maybe_create_entry_wrapper(
144145
ParamEnv::reveal_all(),
145146
start_def_id,
146147
tcx.mk_args(&[main_ret_ty.into()]),
148+
None,
147149
)
148150
.polymorphize(tcx);
149151
let start_func_id = import_function(tcx, m, start_instance);

0 commit comments

Comments
 (0)