1
Fork 0

Add test for forward declared const param defaults

This commit is contained in:
Ellen 2021-06-01 17:44:49 +01:00
parent 80af6b091f
commit ba680aa5f2
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.
@ -2617,7 +2617,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);
}