From 709808e15435036c64bb9535c061a041916e90cd Mon Sep 17 00:00:00 2001 From: Guillaume Lessard Date: Fri, 7 Nov 2025 15:58:51 -0800 Subject: [PATCH] Use updated spelling for lifetime annotations. (#1584) --- 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 a2b1ccf4b..d0c25c67d 100644 --- a/Package.swift +++ b/Package.swift @@ -147,7 +147,7 @@ let package = Package( ] + wasiLibcCSettings, swiftSettings: [ .enableExperimentalFeature("VariadicGenerics"), - .enableExperimentalFeature("LifetimeDependence"), + .enableExperimentalFeature("Lifetimes"), .enableExperimentalFeature("AddressableTypes"), .enableExperimentalFeature("AllowUnsafeAttribute"), .enableExperimentalFeature("BuiltinModule"), diff --git a/Sources/FoundationEssentials/CMakeLists.txt b/Sources/FoundationEssentials/CMakeLists.txt index 36b6e34cb..00d41bbfe 100644 --- a/Sources/FoundationEssentials/CMakeLists.txt +++ b/Sources/FoundationEssentials/CMakeLists.txt @@ -82,7 +82,7 @@ endif() target_compile_options(FoundationEssentials PRIVATE "SHELL:$<$:-Xfrontend -enable-experimental-feature -Xfrontend VariadicGenerics>" - "SHELL:$<$:-Xfrontend -enable-experimental-feature -Xfrontend LifetimeDependence>" + "SHELL:$<$:-Xfrontend -enable-experimental-feature -Xfrontend Lifetimes>" "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 462d03b3c..db43f8d5d 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