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