Sema: Allow some @_implementationOnly imports in stdlib modules.

The `_Concurrency` module imports a C module that is not available in the
toolchain or SDK, which means that `@_implementationOnly` must be used to hide
the dependency on this module from clients.
This commit is contained in:
Allan Shortlidge
2024-09-09 12:25:22 -07:00
parent 99fd29c3b9
commit 2ec8efea91

View File

@@ -797,6 +797,9 @@ void UnboundImport::validateInterfaceWithPackageName(ModuleDecl *topLevelModule,
/// be hidden from clients.
static bool shouldSuppressNonResilientImplementationOnlyImportDiagnostic(
StringRef targetName, StringRef importerName) {
if (targetName == "SwiftConcurrencyInternalShims")
return importerName == "_Concurrency";
if (targetName == "CCryptoBoringSSL" || targetName == "CCryptoBoringSSLShims")
return importerName == "Crypto" || importerName == "_CryptoExtras" ||
importerName == "CryptoBoringWrapper";