Rollup merge of #103870 - TaKO8Ki:fix-103790, r=fee1-dead

Fix `inferred_kind` ICE

Fixes #103790
This commit is contained in:
Matthias Krüger
2022-11-02 22:06:27 +01:00
committed by GitHub
3 changed files with 78 additions and 0 deletions

View File

@@ -500,6 +500,9 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
}
GenericParamDefKind::Const { has_default } => {
let ty = tcx.at(self.span).type_of(param.def_id);
if ty.references_error() {
return tcx.const_error(ty).into();
}
if !infer_args && has_default {
tcx.bound_const_param_default(param.def_id)
.subst(tcx, substs.unwrap())