@@ -3471,26 +3471,25 @@ SerializeAttrGenericSignatureRequest::evaluate(Evaluator &evaluator,
3471
3471
// Check the validity of provided requirements.
3472
3472
checkSpecializeAttrRequirements (attr, genericSig, specializedSig, Ctx);
3473
3473
3474
- if (Ctx.LangOpts .hasFeature (Feature::LayoutPrespecialization)) {
3475
- llvm::SmallVector<Type, 4 > typeErasedParams;
3476
- for (const auto &reqRepr :
3477
- attr->getTrailingWhereClause ()->getRequirements ()) {
3478
- if (reqRepr.getKind () == RequirementReprKind::LayoutConstraint) {
3479
- if (auto *attributedTy = dyn_cast<AttributedTypeRepr>(reqRepr.getSubjectRepr ())) {
3480
- if (attributedTy->has (TypeAttrKind::NoMetadata)) {
3481
- const auto resolution = TypeResolution::forInterface (
3482
- FD->getDeclContext (), genericSig, std::nullopt ,
3483
- /* unboundTyOpener*/ nullptr ,
3484
- /* placeholderHandler*/ nullptr ,
3485
- /* packElementOpener*/ nullptr );
3486
- const auto ty = resolution.resolveType (attributedTy);
3487
- typeErasedParams.push_back (ty);
3488
- }
3474
+ llvm::SmallVector<Type, 4 > typeErasedParams;
3475
+ for (const auto &reqRepr :
3476
+ attr->getTrailingWhereClause ()->getRequirements ()) {
3477
+ if (reqRepr.getKind () == RequirementReprKind::LayoutConstraint) {
3478
+ if (auto *attributedTy =
3479
+ dyn_cast<AttributedTypeRepr>(reqRepr.getSubjectRepr ())) {
3480
+ if (attributedTy->has (TypeAttrKind::NoMetadata)) {
3481
+ const auto resolution = TypeResolution::forInterface (
3482
+ FD->getDeclContext (), genericSig, std::nullopt ,
3483
+ /* unboundTyOpener*/ nullptr ,
3484
+ /* placeholderHandler*/ nullptr ,
3485
+ /* packElementOpener*/ nullptr );
3486
+ const auto ty = resolution.resolveType (attributedTy);
3487
+ typeErasedParams.push_back (ty);
3489
3488
}
3490
3489
}
3491
3490
}
3492
- attr->setTypeErasedParams (typeErasedParams);
3493
3491
}
3492
+ attr->setTypeErasedParams (typeErasedParams);
3494
3493
3495
3494
// Check the target function if there is one.
3496
3495
attr->getTargetFunctionDecl (FD);
@@ -4885,13 +4884,6 @@ AttributeChecker::visitSPIOnlyAttr(SPIOnlyAttr *attr) {
4885
4884
}
4886
4885
4887
4886
void AttributeChecker::visitNoMetadataAttr (NoMetadataAttr *attr) {
4888
- if (!Ctx.LangOpts .hasFeature (Feature::LayoutPrespecialization)) {
4889
- auto error =
4890
- diag::experimental_no_metadata_feature_can_only_be_used_when_enabled;
4891
- diagnoseAndRemoveAttr (attr, error);
4892
- return ;
4893
- }
4894
-
4895
4887
if (!isa<GenericTypeParamDecl>(D)) {
4896
4888
attr->setInvalid ();
4897
4889
diagnoseAndRemoveAttr (attr, diag::no_metadata_on_non_generic_param);
0 commit comments