1
Fork 0

bug! with a better error message for failing Instance::resolve

This commit is contained in:
Michael Goulet 2022-12-11 19:46:58 +00:00
parent d137783642
commit bc293ed53e
4 changed files with 34 additions and 15 deletions

View file

@ -751,10 +751,13 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
let (instance, mut llfn) = match *callee.layout.ty.kind() {
ty::FnDef(def_id, substs) => (
Some(
ty::Instance::resolve(bx.tcx(), ty::ParamEnv::reveal_all(), def_id, substs)
.unwrap()
.unwrap()
.polymorphize(bx.tcx()),
ty::Instance::expect_resolve(
bx.tcx(),
ty::ParamEnv::reveal_all(),
def_id,
substs,
)
.polymorphize(bx.tcx()),
),
None,
),