Feed type_of query instead of using WithOptconstParam.

This commit is contained in:
Camille GILLOT 2023-02-19 10:02:00 +00:00
parent 4224b4b1f5
commit 0e017fc94a
7 changed files with 40 additions and 39 deletions

View file

@ -15,12 +15,6 @@ fn resolve_instance<'tcx>(
key: ty::ParamEnvAnd<'tcx, (DefId, SubstsRef<'tcx>)>,
) -> Result<Option<Instance<'tcx>>, ErrorGuaranteed> {
let (param_env, (did, substs)) = key.into_parts();
if let Some(did) = did.as_local() {
if let Some(param_did) = tcx.opt_const_param_of(did) {
return tcx.resolve_instance_of_const_arg(param_env.and((did, param_did, substs)));
}
}
inner_resolve_instance(tcx, param_env.and((ty::WithOptConstParam::unknown(did), substs)))
}