@@ -1069,9 +1069,6 @@ static const char *getImportFailureString(swift::serialization::Status status) {
1069
1069
case swift::serialization::Status::NotInOSSA:
1070
1070
return " The module file was not compiled with -enable-ossa-modules when it "
1071
1071
" was required to do so." ;
1072
- case swift::serialization::Status::NoncopyableGenericsMismatch:
1073
- return " The module file was compiled with a mismatching "
1074
- " -enable-experimental-feature NoncopyableGenerics setting." ;
1075
1072
case swift::serialization::Status::SDKMismatch:
1076
1073
return " The module file was built with a different SDK version." ;
1077
1074
}
@@ -1266,7 +1263,6 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
1266
1263
auto &langOpts = invocation.getLangOptions ();
1267
1264
info = swift::serialization::validateSerializedAST (
1268
1265
buf, invocation.getSILOptions ().EnableOSSAModules ,
1269
- langOpts.hasFeature (swift::Feature::NoncopyableGenerics),
1270
1266
/* requiredSDK*/ StringRef (), &extended_validation_info,
1271
1267
/* dependencies*/ nullptr , &searchPaths);
1272
1268
bool invalid_ast = info.status != swift::serialization::Status::Valid;
@@ -3486,8 +3482,7 @@ swift::ASTContext *SwiftASTContext::GetASTContext() {
3486
3482
std::make_unique<swift::ModuleInterfaceCheckerImpl>(*m_ast_context_ap,
3487
3483
moduleCachePath, prebuiltModuleCachePath,
3488
3484
swift::ModuleInterfaceLoaderOptions (),
3489
- swift::RequireOSSAModules_t (GetSILOptions ()),
3490
- swift::RequireNoncopyableGenerics_t (GetLanguageOptions ())));
3485
+ swift::RequireOSSAModules_t (GetSILOptions ())));
3491
3486
3492
3487
// 2. Create and install the module interface loader.
3493
3488
//
@@ -5653,7 +5648,6 @@ bool SwiftASTContext::GetProtocolTypeInfo(const CompilerType &type,
5653
5648
5654
5649
swift::ExistentialLayout layout = swift_can_type.getExistentialLayout ();
5655
5650
protocol_info.m_is_class_only = layout.requiresClass ();
5656
- protocol_info.m_num_protocols = layout.getProtocols ().size ();
5657
5651
protocol_info.m_is_objc = layout.isObjC ();
5658
5652
protocol_info.m_is_anyobject = layout.isAnyObject ();
5659
5653
protocol_info.m_is_errortype = layout.isErrorExistential ();
@@ -5663,11 +5657,24 @@ bool SwiftASTContext::GetProtocolTypeInfo(const CompilerType &type,
5663
5657
}
5664
5658
5665
5659
unsigned num_witness_tables = 0 ;
5660
+ unsigned num_protocols = 0 ;
5666
5661
for (auto protoDecl : layout.getProtocols ()) {
5662
+ // Ignore invertible protocols like Copyable entirely. They're marker
5663
+ // protocols that are not mangled into generic signatures. Only their
5664
+ // absence is mangled.
5665
+ // FIXME: this should probably be filtering all marker protocols,
5666
+ // including Sendable, since marker protocols lack a witness table.
5667
+ if (protoDecl->getInvertibleProtocolKind ())
5668
+ continue ;
5669
+
5670
+ num_protocols++;
5671
+
5667
5672
if (!protoDecl->isObjC ())
5668
5673
num_witness_tables++;
5669
5674
}
5670
5675
5676
+ protocol_info.m_num_protocols = num_protocols;
5677
+
5671
5678
if (layout.isErrorExistential ()) {
5672
5679
// Error existential -- instance pointer only.
5673
5680
protocol_info.m_num_payload_words = 0 ;
0 commit comments