Fix Nightly Build to work with new Swift versions (#2288)

Swift 5.8 has recently changed the name of the function assign to now be called update. Now, they call update like seen in this proposal:
https://github.com/apple/swift-evolution/blob/main/proposals/0370-pointer-family-initialization-improvements.md

Co-authored-by: Carolina Cassedy <ccassedy@apple.com>
Co-authored-by: Cory Benfield <lukasa@apple.com>
Co-authored-by: David Nadoba <d_nadoba@apple.com>
This commit is contained in:
authored and GitHub committed 2022-10-13 14:29:40 +01:00
1 parent 1d4dc231f9
commit 788b759d0b
1 file changed
+9 -1
+9 -1
View File
@@ -339,7 +339,7 @@ class SocketAddressTest: XCTestCase {
pathBytes.withUnsafeBufferPointer { srcPtr in
withUnsafeMutablePointer(to: &addr.sun_path) { dstPtr in
dstPtr.withMemoryRebound(to: UInt8.self, capacity: srcPtr.count) { dstPtr in
dstPtr.assign(from: srcPtr.baseAddress!, count: srcPtr.count)
dstPtr.update(from: srcPtr.baseAddress!, count: srcPtr.count)
}
}
}
@@ -571,3 +571,11 @@ class SocketAddressTest: XCTestCase {
}
}
}
#if swift(<5.8)
extension UnsafeMutablePointer {
func update(from source: UnsafePointer<Pointee>, count: Int) {
self.assign(from: source, count: count)
}
}
#endif