return const_error when ty has errors
This commit is contained in:
parent
33b55ac39f
commit
b96ad1c096
3 changed files with 78 additions and 0 deletions
|
@ -501,6 +501,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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue