Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Sendable warnings from latest main compiler #166

Merged
merged 3 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/X509/CertificatePrivateKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import SwiftASN1
import Foundation
@preconcurrency import Crypto
@preconcurrency import _CryptoExtras
import _CryptoExtras

extension Certificate {
/// A private key that can be used with a certificate.
Expand Down
2 changes: 1 addition & 1 deletion Sources/X509/CertificatePublicKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import SwiftASN1
@preconcurrency import Crypto
@preconcurrency import _CryptoExtras
import _CryptoExtras
import Foundation

extension Certificate {
Expand Down
3 changes: 3 additions & 0 deletions Sources/X509/Error.swift
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ public struct CertificateError: Error, Hashable, CustomStringConvertible {
}
}

// `CertificateError` is `Sendable` because it uses CoW
extension CertificateError: @unchecked Sendable {}

extension CertificateError {
/// Represents the kind of an error.
///
Expand Down
1 change: 1 addition & 0 deletions Sources/X509/OCSP/OCSPPolicy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ extension OCSPVerifierPolicy.Storage {
return responderURI
}.first
guard let responderURI else {
let ocspAccessDescriptions = Array(ocspAccessDescriptions)
return self.softFailure(
reason: .init("expected OCSP location to be a URI but got \(ocspAccessDescriptions)")
)
Expand Down
4 changes: 2 additions & 2 deletions Sources/X509/PromiseAndFuture.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//

// MARK: - Promise
final class Promise<Value, Failure: Error> {
final class Promise<Value: Sendable, Failure: Error> {
private enum State {
case unfulfilled(observers: [CheckedContinuation<Result<Value, Failure>, Never>])
case fulfilled(Result<Value, Failure>)
Expand Down Expand Up @@ -83,7 +83,7 @@ extension Promise {

// MARK: - Future

struct Future<Value, Failure: Error> {
struct Future<Value: Sendable, Failure: Error> {
private let promise: Promise<Value, Failure>

init(_ promise: Promise<Value, Failure>) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/X509/Signature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//

import SwiftASN1
@preconcurrency import _CryptoExtras
import _CryptoExtras
import Foundation

extension Certificate {
Expand Down