diff --git a/Package.swift b/Package.swift index 448343e7b..eb83633c0 100644 --- a/Package.swift +++ b/Package.swift @@ -148,7 +148,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 2f04ff0be..8175e009f 100644 --- a/Sources/FoundationEssentials/CMakeLists.txt +++ b/Sources/FoundationEssentials/CMakeLists.txt @@ -83,7 +83,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+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) diff --git a/Sources/FoundationEssentials/Data/Data.swift b/Sources/FoundationEssentials/Data/Data.swift index e1cead6ae..ddef89081 100644 --- a/Sources/FoundationEssentials/Data/Data.swift +++ b/Sources/FoundationEssentials/Data/Data.swift @@ -353,7 +353,7 @@ public struct Data : RandomAccessCollection, MutableCollection, RangeReplaceable @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 { @@ -381,7 +381,7 @@ public struct Data : RandomAccessCollection, MutableCollection, RangeReplaceable @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) @@ -391,7 +391,7 @@ public struct Data : RandomAccessCollection, MutableCollection, RangeReplaceable @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 { @@ -427,7 +427,7 @@ public struct Data : RandomAccessCollection, MutableCollection, RangeReplaceable @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