Give Instance::expect_resolve a span

This commit is contained in:
Michael Goulet 2024-06-12 13:06:23 -04:00
parent 5adaed06a0
commit e4bde05ed6
2 changed files with 10 additions and 3 deletions

View file

@ -371,9 +371,14 @@ pub(crate) fn codegen_terminator_call<'tcx>(
// Handle special calls like intrinsics and empty drop glue.
let instance = if let ty::FnDef(def_id, fn_args) = *func.layout().ty.kind() {
let instance =
ty::Instance::expect_resolve(fx.tcx, ty::ParamEnv::reveal_all(), def_id, fn_args)
.polymorphize(fx.tcx);
let instance = ty::Instance::expect_resolve(
fx.tcx,
ty::ParamEnv::reveal_all(),
def_id,
fn_args,
Some(source_info.span),
)
.polymorphize(fx.tcx);
if is_call_from_compiler_builtins_to_upstream_monomorphization(fx.tcx, instance) {
if target.is_some() {

View file

@ -119,6 +119,7 @@ pub(crate) fn maybe_create_entry_wrapper(
ParamEnv::reveal_all(),
report.def_id,
tcx.mk_args(&[GenericArg::from(main_ret_ty)]),
None,
)
.polymorphize(tcx);
@ -144,6 +145,7 @@ pub(crate) fn maybe_create_entry_wrapper(
ParamEnv::reveal_all(),
start_def_id,
tcx.mk_args(&[main_ret_ty.into()]),
None,
)
.polymorphize(tcx);
let start_func_id = import_function(tcx, m, start_instance);