1
Fork 0

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
commit 5784a038fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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())