From c67d9ed90fcab6735ebfb88cf7858517e6fd9862 Mon Sep 17 00:00:00 2001 From: Jonathan Grynspan Date: Wed, 8 Jan 2025 08:19:30 -0500 Subject: [PATCH] Use `Never` instead of `Void` as the fallback lock/mutex type. When using WASI without multithreading, or when using a platform to which Swift Testing has been incompletely ported, we don't know what type to use as a lock/mutex, so we use `Void`. However, turns out that produces a diagnostic: > warning: UnsafeMutablePointer has been replaced by UnsafeMutableRawPointer So use `Never` instead. (Yes, this will produce a pointer to an uninitialized instance of `Never`. If this affects you, please read Porting.md!) --- Sources/Testing/Support/Locked.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Testing/Support/Locked.swift b/Sources/Testing/Support/Locked.swift index d0edbc801..1294da195 100644 --- a/Sources/Testing/Support/Locked.swift +++ b/Sources/Testing/Support/Locked.swift @@ -44,10 +44,10 @@ struct Locked: RawRepresentable, Sendable where T: Sendable { typealias PlatformLock = SRWLOCK #elseif os(WASI) // No locks on WASI without multithreaded runtime. - typealias PlatformLock = Void + typealias PlatformLock = Never #else #warning("Platform-specific implementation missing: locking unavailable") - typealias PlatformLock = Void + typealias PlatformLock = Never #endif /// A type providing heap-allocated storage for an instance of ``Locked``.