Skip to content

Commit f64263a

Browse files
authored
Enabled -require-explicit-sendable compiler flag (#549)
Enabled -require-explicit-sendable compiler flag and fixed the errors highlighted by the compiler.
1 parent dacd828 commit f64263a

File tree

6 files changed

+17
-1
lines changed

6 files changed

+17
-1
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ jobs:
5353
with:
5454
runner_pool: nightly
5555
build_scheme: swift-nio-ssl-Package
56+
xcode_16_2_build_arguments_override: "-Xswiftc -Xfrontend -Xswiftc -require-explicit-sendable"
57+
xcode_16_3_build_arguments_override: "-Xswiftc -Xfrontend -Xswiftc -require-explicit-sendable"
5658

5759
static-sdk:
5860
name: Static SDK

.github/workflows/pull_request.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ jobs:
6060
with:
6161
runner_pool: general
6262
build_scheme: swift-nio-ssl-Package
63+
xcode_16_2_build_arguments_override: "-Xswiftc -Xfrontend -Xswiftc -require-explicit-sendable"
64+
xcode_16_3_build_arguments_override: "-Xswiftc -Xfrontend -Xswiftc -require-explicit-sendable"
6365

6466
static-sdk:
6567
name: Static SDK

Sources/NIOSSL/NIOSSLClientHandler.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,6 @@ public final class NIOSSLClientHandler: NIOSSLHandler {
212212
)
213213
}
214214
}
215+
216+
@available(*, unavailable)
217+
extension NIOSSLClientHandler: Sendable {}

Sources/NIOSSL/NIOSSLServerHandler.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,6 @@ public final class NIOSSLServerHandler: NIOSSLHandler {
130130
)
131131
}
132132
}
133+
134+
@available(*, unavailable)
135+
extension NIOSSLServerHandler: Sendable {}

Sources/NIOSSL/SSLPrivateKey.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,3 +457,6 @@ extension NIOSSLPrivateKey: Hashable {
457457
}
458458
}
459459
}
460+
461+
@available(*, unavailable)
462+
extension NIOSSLPrivateKey.Representation: Sendable {}

Sources/NIOSSL/SwiftCrypto/NIOSSLSecureBytes.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ extension NIOSSLSecureBytes: RangeReplaceableCollection {
159159
// MARK: - Heap allocated backing storage.
160160
extension NIOSSLSecureBytes {
161161
@usableFromInline
162-
internal struct BackingHeader {
162+
internal struct BackingHeader: Sendable {
163163
@usableFromInline
164164
internal var count: Int
165165

@@ -240,6 +240,9 @@ extension NIOSSLSecureBytes {
240240
}
241241
}
242242

243+
@available(*, unavailable)
244+
extension NIOSSLSecureBytes.Backing: Sendable {}
245+
243246
extension NIOSSLSecureBytes.Backing {
244247
@usableFromInline
245248
func replaceSubrangeFittingWithinCapacity<C: Collection>(_ subrange: Range<Int>, with newElements: C)

0 commit comments

Comments
 (0)