Rollup merge of #85896 - BoxyUwU:remove-fixme-fwd-declared-const-default, r=petrochenkov

Add test for forward declared const param defaults
This commit is contained in:
Yuki Okushi
2021-06-03 14:35:36 +09:00
committed by GitHub
4 changed files with 45 additions and 3 deletions

View File

@@ -242,7 +242,7 @@ enum ResolutionError<'a> {
shadowed_binding_span: Span,
},
/// Error E0128: generic parameters with a default cannot use forward-declared identifiers.
ForwardDeclaredTyParam, // FIXME(const_generics_defaults)
ForwardDeclaredGenericParam,
/// ERROR E0770: the type of const parameters must not depend on other generic parameters.
ParamInTyOfConstParam(Symbol),
/// generic parameters must not be used inside const evaluations.
@@ -2608,7 +2608,7 @@ impl<'a> Resolver<'a> {
let res_error = if rib_ident.name == kw::SelfUpper {
ResolutionError::SelfInTyParamDefault
} else {
ResolutionError::ForwardDeclaredTyParam
ResolutionError::ForwardDeclaredGenericParam
};
self.report_error(span, res_error);
}