From a0c06f2304ea633572e23651c532aabc4c1b657e Mon Sep 17 00:00:00 2001 From: Guillaume Lessard Date: Wed, 19 Nov 2025 12:57:30 -0800 Subject: [PATCH 1/2] Revert "Use updated spelling for lifetime annotations. (#1584)" This reverts commit 709808e15435036c64bb9535c061a041916e90cd. --- Package.swift | 2 +- Sources/FoundationEssentials/CMakeLists.txt | 2 +- Sources/FoundationEssentials/Data/Data.swift | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Package.swift b/Package.swift index d0c25c67d..a2b1ccf4b 100644 --- a/Package.swift +++ b/Package.swift @@ -147,7 +147,7 @@ let package = Package( ] + wasiLibcCSettings, swiftSettings: [ .enableExperimentalFeature("VariadicGenerics"), - .enableExperimentalFeature("Lifetimes"), + .enableExperimentalFeature("LifetimeDependence"), .enableExperimentalFeature("AddressableTypes"), .enableExperimentalFeature("AllowUnsafeAttribute"), .enableExperimentalFeature("BuiltinModule"), diff --git a/Sources/FoundationEssentials/CMakeLists.txt b/Sources/FoundationEssentials/CMakeLists.txt index d009cde11..a5a1e9c79 100644 --- a/Sources/FoundationEssentials/CMakeLists.txt +++ b/Sources/FoundationEssentials/CMakeLists.txt @@ -81,7 +81,7 @@ endif() target_compile_options(FoundationEssentials PRIVATE "SHELL:$<$:-Xfrontend -enable-experimental-feature -Xfrontend VariadicGenerics>" - "SHELL:$<$:-Xfrontend -enable-experimental-feature -Xfrontend Lifetimes>" + "SHELL:$<$:-Xfrontend -enable-experimental-feature -Xfrontend LifetimeDependence>" "SHELL:$<$:-Xfrontend -enable-experimental-feature -Xfrontend AddressableTypes>" "SHELL:$<$:-Xfrontend -enable-experimental-feature -Xfrontend BuiltinModule>" "SHELL:$<$:-Xfrontend -enable-experimental-feature -Xfrontend AccessLevelOnImport>" diff --git a/Sources/FoundationEssentials/Data/Data.swift b/Sources/FoundationEssentials/Data/Data.swift index db43f8d5d..462d03b3c 100644 --- a/Sources/FoundationEssentials/Data/Data.swift +++ b/Sources/FoundationEssentials/Data/Data.swift @@ -2212,7 +2212,7 @@ public struct Data : Equatable, Hashable, RandomAccessCollection, MutableCollect @available(macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, *) @_alwaysEmitIntoClient public var bytes: RawSpan { - @_lifetime(borrow self) + @lifetime(borrow self) borrowing get { let buffer: UnsafeRawBufferPointer switch _representation { @@ -2240,7 +2240,7 @@ public struct Data : Equatable, Hashable, RandomAccessCollection, MutableCollect @available(macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, *) @_alwaysEmitIntoClient public var span: Span { - @_lifetime(borrow self) + @lifetime(borrow self) borrowing get { let span = unsafe bytes._unsafeView(as: UInt8.self) return _overrideLifetime(span, borrowing: self) @@ -2250,7 +2250,7 @@ public struct Data : Equatable, Hashable, RandomAccessCollection, MutableCollect @available(macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, *) @_alwaysEmitIntoClient public var mutableBytes: MutableRawSpan { - @_lifetime(&self) + @lifetime(&self) mutating get { let buffer: UnsafeMutableRawBufferPointer switch _representation { @@ -2286,7 +2286,7 @@ public struct Data : Equatable, Hashable, RandomAccessCollection, MutableCollect @available(macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, *) @_alwaysEmitIntoClient public var mutableSpan: MutableSpan { - @_lifetime(&self) + @lifetime(&self) mutating get { #if false // see https://github.com/swiftlang/swift/issues/81218 var bytes = mutableBytes From 29ffa3d071ead679de02854e85d703f4f4ef794e Mon Sep 17 00:00:00 2001 From: Guillaume Lessard Date: Wed, 19 Nov 2025 13:06:36 -0800 Subject: [PATCH 2/2] Revert "Use updated spelling for lifetime annotations." This reverts commit b9bdc6ff329b06c5881481f23687e23a5757bcf0. --- Sources/FoundationEssentials/Data/Data+Reading.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/FoundationEssentials/Data/Data+Reading.swift b/Sources/FoundationEssentials/Data/Data+Reading.swift index 4dd3714a3..a7421ead4 100644 --- a/Sources/FoundationEssentials/Data/Data+Reading.swift +++ b/Sources/FoundationEssentials/Data/Data+Reading.swift @@ -193,7 +193,7 @@ struct ReadBytesResult { } #if os(Windows) -@_lifetime(pBuffer: copy pBuffer) +@lifetime(pBuffer: copy pBuffer) private func read(from hFile: HANDLE, at path: PathOrURL, into pBuffer: inout OutputRawSpan, chunkSize dwChunk: Int = 4096, progress bProgress: Bool)