From af112c15915f327976ee5c4292bcb7488f41981a Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Sat, 17 Feb 2024 09:58:20 -0800 Subject: [PATCH 1/7] Update the Swift version to 6.0 from 5.11 --- CHANGELOG.md | 2 +- cmake/SwiftVersion.cmake | 4 +- docs/ABI/Mangling.rst | 2 +- include/swift/AST/ASTContext.h | 6 +- include/swift/Demangling/DemangleNodes.def | 4 +- lib/Basic/Version.cpp | 6 +- lib/Driver/DarwinToolChains.cpp | 4 +- lib/Frontend/CompilerInvocation.cpp | 4 +- lib/IRGen/GenReflection.cpp | 4 +- .../DistributedProtocolMacro.swift | 4 +- .../Concurrency/AsyncCompactMapSequence.swift | 4 +- .../Concurrency/AsyncDropFirstSequence.swift | 4 +- .../Concurrency/AsyncDropWhileSequence.swift | 4 +- .../Concurrency/AsyncFilterSequence.swift | 4 +- .../Concurrency/AsyncFlatMapSequence.swift | 4 +- .../Concurrency/AsyncIteratorProtocol.swift | 6 +- .../public/Concurrency/AsyncMapSequence.swift | 4 +- .../Concurrency/AsyncPrefixSequence.swift | 4 +- .../AsyncPrefixWhileSequence.swift | 4 +- stdlib/public/Concurrency/AsyncSequence.swift | 2 +- stdlib/public/Concurrency/AsyncStream.swift | 4 +- .../AsyncThrowingCompactMapSequence.swift | 2 +- .../AsyncThrowingDropWhileSequence.swift | 2 +- .../AsyncThrowingFilterSequence.swift | 2 +- .../AsyncThrowingFlatMapSequence.swift | 2 +- .../AsyncThrowingMapSequence.swift | 2 +- .../AsyncThrowingPrefixWhileSequence.swift | 2 +- .../Concurrency/AsyncThrowingStream.swift | 2 +- stdlib/public/Concurrency/TaskGroup.swift | 2 +- .../public/Distributed/DistributedActor.swift | 6 +- .../Distributed/DistributedActorSystem.swift | 2 +- .../Distributed/DistributedMetadata.swift | 4 +- .../Observation/ObservationTracking.swift | 2 +- stdlib/public/Synchronization/Atomic.swift | 12 +- .../public/Synchronization/AtomicBool.swift | 16 +- .../public/Synchronization/AtomicFloats.swift | 24 +-- .../Synchronization/AtomicIntegers.swift.gyb | 20 +-- .../Synchronization/AtomicLazyReference.swift | 12 +- .../AtomicMemoryOrderings.swift | 80 +++++----- .../Synchronization/AtomicOptional.swift | 18 +-- .../Synchronization/AtomicPointers.swift | 144 +++++++++--------- .../Synchronization/AtomicRepresentable.swift | 26 ++-- .../Synchronization/AtomicStorage.swift.gyb | 32 ++-- stdlib/public/Synchronization/WordPair.swift | 28 ++-- stdlib/public/core/Availability.swift | 4 +- stdlib/public/core/CollectionAlgorithms.swift | 4 +- stdlib/public/core/DebuggerSupport.swift | 10 +- stdlib/public/core/DiscontiguousSlice.swift | 34 ++--- stdlib/public/core/ErrorType.swift | 2 +- stdlib/public/core/MutableCollection.swift | 2 +- .../core/RangeReplaceableCollection.swift | 4 +- stdlib/public/core/RangeSet.swift | 14 +- stdlib/public/core/RangeSetRanges.swift | 18 +-- stdlib/public/core/String.swift | 4 +- stdlib/public/core/StringCreate.swift | 2 +- test/Casting/CastTraps.swift.gyb | 4 +- test/Concurrency/typed_throws.swift | 4 +- ...expansion_DistributedProtocol_simple.swift | 2 +- test/IRGen/objc.swift | 4 +- ...objc-trap-on-exception-irgen-itanium.swift | 2 +- .../trap-on-exception-irgen-itanium.swift | 4 +- test/Macros/macro_expand_body.swift | 2 +- ...-module-interfaces-no-lazy-typecheck.swift | 2 +- test/Runtime/demangleToMetadata.swift | 4 +- .../Serialization/Recovery/types-5-to-4.swift | 4 +- test/SourceKit/Misc/compiler_version.swift | 4 +- test/stdlib/Atomics/AtomicLazyReference.swift | 4 +- test/stdlib/Atomics/Basics/Tests.gyb-template | 4 +- .../Atomics/LockFreeSingleConsumerStack.swift | 6 +- test/stdlib/Atomics/WordPair.swift | 6 +- test/stdlib/Error.swift | 4 +- test/stdlib/StringCreate.swift | 30 ++-- utils/availability-macros.def | 4 +- utils/build_swift/build_swift/defaults.py | 2 +- validation-test/stdlib/RangeSet.swift | 4 +- 75 files changed, 362 insertions(+), 362 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d18a62fd7f06..92b332daa0593 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ > **Note**\ > This is in reverse chronological order, so newer entries are added to the top. -## Swift 5.11 +## Swift 6.0 * [SE-0422][]: Non-built-in expression macros can now be used as default arguments that expand at each call site. For example, a custom `#CurrentFile` macro used as diff --git a/cmake/SwiftVersion.cmake b/cmake/SwiftVersion.cmake index 2a78a341bef14..9a695857ce58f 100644 --- a/cmake/SwiftVersion.cmake +++ b/cmake/SwiftVersion.cmake @@ -1,7 +1,7 @@ # SWIFT_VERSION is deliberately /not/ cached so that an existing build directory # can be reused when a new version of Swift comes out (assuming the user hasn't # manually set it as part of their own CMake configuration). -set(SWIFT_VERSION_MAJOR 5) -set(SWIFT_VERSION_MINOR 11) +set(SWIFT_VERSION_MAJOR 6) +set(SWIFT_VERSION_MINOR 0) set(SWIFT_VERSION "${SWIFT_VERSION_MAJOR}.${SWIFT_VERSION_MINOR}") diff --git a/docs/ABI/Mangling.rst b/docs/ABI/Mangling.rst index d214e06f19dfd..d3531ec64bc8a 100644 --- a/docs/ABI/Mangling.rst +++ b/docs/ABI/Mangling.rst @@ -656,7 +656,7 @@ Types function-isolation ::= type 'Yc' // Global actor on function type #endif throws ::= 'K' // 'throws' annotation on function types - #if SWIFT_RUNTIME_VERSION >= 5.11 + #if SWIFT_RUNTIME_VERSION >= 6.0 throws ::= type 'YK' // 'throws(type)' annotation on function types function-isolation ::= type 'YA' // @isolated(any) on function type #endif diff --git a/include/swift/AST/ASTContext.h b/include/swift/AST/ASTContext.h index c136634716a88..7011787be63aa 100644 --- a/include/swift/AST/ASTContext.h +++ b/include/swift/AST/ASTContext.h @@ -990,10 +990,10 @@ class ASTContext final { return getSwiftAvailability(5, 10); } - /// Get the runtime availability of features introduced in the Swift 5.11 + /// Get the runtime availability of features introduced in the Swift 6.0 /// compiler for the target platform. - inline AvailabilityContext getSwift511Availability() const { - return getSwiftAvailability(5, 11); + inline AvailabilityContext getSwift60Availability() const { + return getSwiftAvailability(6, 0); } /// Get the runtime availability for a particular version of Swift (5.0+). diff --git a/include/swift/Demangling/DemangleNodes.def b/include/swift/Demangling/DemangleNodes.def index fb581148a9d3f..2026f65cb85f9 100644 --- a/include/swift/Demangling/DemangleNodes.def +++ b/include/swift/Demangling/DemangleNodes.def @@ -358,7 +358,7 @@ NODE(AsyncSuspendResumePartialFunction) NODE(AccessibleFunctionRecord) NODE(CompileTimeConst) -// Added in Swift 5.11 +// Added in Swift 6.0 NODE(AccessibleProtocolRequirementFunctionRecord) // Added in Swift 5.7 @@ -376,7 +376,7 @@ NODE(HasSymbolQuery) NODE(OpaqueReturnTypeIndex) NODE(OpaqueReturnTypeParent) -// Addedn in Swift 5.11 +// Addedn in Swift 6.0 NODE(OutlinedEnumTagStore) NODE(OutlinedEnumProjectDataForLoad) NODE(OutlinedEnumGetTag) diff --git a/lib/Basic/Version.cpp b/lib/Basic/Version.cpp index 68c5da782ed9e..773fb4affa94d 100644 --- a/lib/Basic/Version.cpp +++ b/lib/Basic/Version.cpp @@ -176,11 +176,11 @@ llvm::Optional Version::getEffectiveLanguageVersion() const { assert(size() == 2 && Components[0] == 4 && Components[1] == 2); return Version{4, 2}; case 5: - static_assert(SWIFT_VERSION_MAJOR == 5, + return Version{5}; + case 6: + static_assert(SWIFT_VERSION_MAJOR == 6, "getCurrentLanguageVersion is no longer correct here"); return Version::getCurrentLanguageVersion(); - case 6: - return Version{6}; default: return llvm::None; } diff --git a/lib/Driver/DarwinToolChains.cpp b/lib/Driver/DarwinToolChains.cpp index 021ee11588158..6b136656ef584 100644 --- a/lib/Driver/DarwinToolChains.cpp +++ b/lib/Driver/DarwinToolChains.cpp @@ -384,8 +384,8 @@ toolchains::Darwin::addArgsToLinkStdlib(ArgStringList &Arguments, runtimeCompatibilityVersion = llvm::VersionTuple(5, 6); } else if (value.equals("5.8")) { runtimeCompatibilityVersion = llvm::VersionTuple(5, 8); - } else if (value.equals("5.11")) { - runtimeCompatibilityVersion = llvm::VersionTuple(5, 11); + } else if (value.equals("6.0")) { + runtimeCompatibilityVersion = llvm::VersionTuple(6, 0); } else if (value.equals("none")) { runtimeCompatibilityVersion = llvm::None; } else { diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index cba47b0c28301..de6a53ea961dd 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -2903,8 +2903,8 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args, runtimeCompatibilityVersion = llvm::VersionTuple(5, 6); } else if (version.equals("5.8")) { runtimeCompatibilityVersion = llvm::VersionTuple(5, 8); - } else if (version.equals("5.11")) { - runtimeCompatibilityVersion = llvm::VersionTuple(5, 11); + } else if (version.equals("6.0")) { + runtimeCompatibilityVersion = llvm::VersionTuple(6, 0); } else { Diags.diagnose(SourceLoc(), diag::error_invalid_arg_value, versionArg->getAsString(Args), version); diff --git a/lib/IRGen/GenReflection.cpp b/lib/IRGen/GenReflection.cpp index fb936c73a261e..c8a01bad4241a 100644 --- a/lib/IRGen/GenReflection.cpp +++ b/lib/IRGen/GenReflection.cpp @@ -176,7 +176,7 @@ class PrintMetadataSource llvm::Optional getRuntimeVersionThatSupportsDemanglingType(CanType type) { - // The Swift 5.11 runtime is the first version able to demangle types + // The Swift 6.0 runtime is the first version able to demangle types // that involve typed throws. bool usesTypedThrows = type.findIf([](CanType t) -> bool { if (auto fn = dyn_cast(t)) { @@ -187,7 +187,7 @@ getRuntimeVersionThatSupportsDemanglingType(CanType type) { return false; }); if (usesTypedThrows) { - return llvm::VersionTuple(5, 11); + return llvm::VersionTuple(6, 0); } // The Swift 5.5 runtime is the first version able to demangle types diff --git a/lib/Macros/Sources/SwiftMacros/DistributedProtocolMacro.swift b/lib/Macros/Sources/SwiftMacros/DistributedProtocolMacro.swift index e45132553df40..2b65ada6df87b 100644 --- a/lib/Macros/Sources/SwiftMacros/DistributedProtocolMacro.swift +++ b/lib/Macros/Sources/SwiftMacros/DistributedProtocolMacro.swift @@ -37,7 +37,7 @@ public struct DistributedProtocolMacro: ExtensionMacro, PeerMacro { .map { req in """ \(req) { - if #available(SwiftStdlib 5.11, *) { + if #available(SwiftStdlib 6.0, *) { Distributed._distributedStubFatalError() } else { fatalError() @@ -76,7 +76,7 @@ public struct DistributedProtocolMacro: ExtensionMacro, PeerMacro { .map { req in """ \(req) { - if #available(SwiftStdlib 5.11, *) { + if #available(SwiftStdlib 6.0, *) { Distributed._distributedStubFatalError() } else { fatalError() diff --git a/stdlib/public/Concurrency/AsyncCompactMapSequence.swift b/stdlib/public/Concurrency/AsyncCompactMapSequence.swift index 268cb1dc8c4ed..38eb415657ed0 100644 --- a/stdlib/public/Concurrency/AsyncCompactMapSequence.swift +++ b/stdlib/public/Concurrency/AsyncCompactMapSequence.swift @@ -85,7 +85,7 @@ extension AsyncCompactMapSequence: AsyncSequence { /// /// The compact map sequence produces whatever type of error its /// base sequence does. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias Failure = Base.Failure /// The type of iterator that produces elements of the sequence. public typealias AsyncIterator = Iterator @@ -138,7 +138,7 @@ extension AsyncCompactMapSequence: AsyncSequence { /// transform returns a non-`nil` value. If the transform returns `nil`, /// this method continues to wait for further elements until it gets one /// that transforms to a non-`nil` value. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public mutating func next(isolation actor: isolated (any Actor)?) async throws(Failure) -> ElementOfResult? { while true { diff --git a/stdlib/public/Concurrency/AsyncDropFirstSequence.swift b/stdlib/public/Concurrency/AsyncDropFirstSequence.swift index 77c09a5e599ee..bbad49caa493d 100644 --- a/stdlib/public/Concurrency/AsyncDropFirstSequence.swift +++ b/stdlib/public/Concurrency/AsyncDropFirstSequence.swift @@ -74,7 +74,7 @@ extension AsyncDropFirstSequence: AsyncSequence { /// /// The drop-first sequence produces whatever type of error its base /// sequence produces. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias Failure = Base.Failure /// The type of iterator that produces elements of the sequence. public typealias AsyncIterator = Iterator @@ -123,7 +123,7 @@ extension AsyncDropFirstSequence: AsyncSequence { /// iterator returns `nil`. After reaching the number of elements to drop, /// this iterator passes along the result of calling `next(isolation:)` on /// the base iterator. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public mutating func next(isolation actor: isolated (any Actor)?) async throws(Failure) -> Base.Element? { var remainingToDrop = count diff --git a/stdlib/public/Concurrency/AsyncDropWhileSequence.swift b/stdlib/public/Concurrency/AsyncDropWhileSequence.swift index e3871e98ce499..69e08dba93af5 100644 --- a/stdlib/public/Concurrency/AsyncDropWhileSequence.swift +++ b/stdlib/public/Concurrency/AsyncDropWhileSequence.swift @@ -83,7 +83,7 @@ extension AsyncDropWhileSequence: AsyncSequence { /// /// The drop-while sequence produces whatever type of error its base /// sequence produces. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias Failure = Base.Failure /// The type of iterator that produces elements of the sequence. public typealias AsyncIterator = Iterator @@ -136,7 +136,7 @@ extension AsyncDropWhileSequence: AsyncSequence { /// method returns that value. After that, the iterator returns values /// received from its base iterator as-is, and never executes the predicate /// closure again. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public mutating func next(isolation actor: isolated (any Actor)?) async throws(Failure) -> Base.Element? { while let predicate = self.predicate { diff --git a/stdlib/public/Concurrency/AsyncFilterSequence.swift b/stdlib/public/Concurrency/AsyncFilterSequence.swift index ca664a3f42e2e..d9e3d54c2856e 100644 --- a/stdlib/public/Concurrency/AsyncFilterSequence.swift +++ b/stdlib/public/Concurrency/AsyncFilterSequence.swift @@ -73,7 +73,7 @@ extension AsyncFilterSequence: AsyncSequence { /// /// The filter sequence produces whatever type of error its /// base sequence does. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias Failure = Base.Failure /// The type of iterator that produces elements of the sequence. public typealias AsyncIterator = Iterator @@ -121,7 +121,7 @@ extension AsyncFilterSequence: AsyncSequence { /// `next(isolation:)` evaluates the result with the `predicate` closure. If /// the closure returns `true`, `next(isolation:)` returns the received /// element; otherwise it awaits the next element from the base iterator. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public mutating func next(isolation actor: isolated (any Actor)?) async throws(Failure) -> Base.Element? { while true { diff --git a/stdlib/public/Concurrency/AsyncFlatMapSequence.swift b/stdlib/public/Concurrency/AsyncFlatMapSequence.swift index 932b0aec577e7..63a5e6fb4d366 100644 --- a/stdlib/public/Concurrency/AsyncFlatMapSequence.swift +++ b/stdlib/public/Concurrency/AsyncFlatMapSequence.swift @@ -189,7 +189,7 @@ extension AsyncFlatMapSequence: AsyncSequence { /// sequence. By construction, the sequence produced by the `transform` /// closure must either produce this type of error or not produce errors /// at all. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias Failure = Base.Failure /// The type of iterator that produces elements of the sequence. public typealias AsyncIterator = Iterator @@ -275,7 +275,7 @@ extension AsyncFlatMapSequence: AsyncSequence { /// from this iterator until it terminates. At this point, /// `next(isolation:)` is ready to receive the next value from the base /// sequence. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public mutating func next(isolation actor: isolated (any Actor)?) async throws(Failure) -> SegmentOfResult.Element? { while !finished { diff --git a/stdlib/public/Concurrency/AsyncIteratorProtocol.swift b/stdlib/public/Concurrency/AsyncIteratorProtocol.swift index 635fb4f9de731..56ff75bc56f35 100644 --- a/stdlib/public/Concurrency/AsyncIteratorProtocol.swift +++ b/stdlib/public/Concurrency/AsyncIteratorProtocol.swift @@ -90,7 +90,7 @@ public protocol AsyncIteratorProtocol { associatedtype Element /// The type of failure produced by iteration. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) associatedtype Failure: Error = any Error /// Asynchronously advances to the next element and returns it, or ends the @@ -105,7 +105,7 @@ public protocol AsyncIteratorProtocol { /// /// - Returns: The next element, if it exists, or `nil` to signal the end of /// the sequence. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) mutating func next(isolation actor: isolated (any Actor)?) async throws(Failure) -> Element? } @@ -113,7 +113,7 @@ public protocol AsyncIteratorProtocol { extension AsyncIteratorProtocol { /// Default implementation of `next()` in terms of `next()`, which is /// required to maintain backward compatibility with existing async iterators. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public mutating func next(isolation actor: isolated (any Actor)?) async throws(Failure) -> Element? { do { diff --git a/stdlib/public/Concurrency/AsyncMapSequence.swift b/stdlib/public/Concurrency/AsyncMapSequence.swift index 67076aac3bbda..30b0f092021b4 100644 --- a/stdlib/public/Concurrency/AsyncMapSequence.swift +++ b/stdlib/public/Concurrency/AsyncMapSequence.swift @@ -83,7 +83,7 @@ extension AsyncMapSequence: AsyncSequence { /// /// The map sequence produces whatever type of error its /// base sequence does. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias Failure = Base.Failure /// The type of iterator that produces elements of the sequence. public typealias AsyncIterator = Iterator @@ -124,7 +124,7 @@ extension AsyncMapSequence: AsyncSequence { /// call returns `nil`, `next(isolation:)` returns `nil`. Otherwise, /// `next(isolation:)` returns the result of calling the transforming /// closure on the received element. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public mutating func next(isolation actor: isolated (any Actor)?) async throws(Failure) -> Transformed? { guard let element = try await baseIterator.next(isolation: actor) else { diff --git a/stdlib/public/Concurrency/AsyncPrefixSequence.swift b/stdlib/public/Concurrency/AsyncPrefixSequence.swift index 7d8287359363d..4a0957bfd7571 100644 --- a/stdlib/public/Concurrency/AsyncPrefixSequence.swift +++ b/stdlib/public/Concurrency/AsyncPrefixSequence.swift @@ -74,7 +74,7 @@ extension AsyncPrefixSequence: AsyncSequence { /// /// The prefix sequence produces whatever type of error its /// base sequence does. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias Failure = Base.Failure /// The type of iterator that produces elements of the sequence. public typealias AsyncIterator = Iterator @@ -115,7 +115,7 @@ extension AsyncPrefixSequence: AsyncSequence { /// `next(isolation:)` on its base iterator and passes through the /// result. After reaching the maximum number of elements, subsequent calls /// to `next(isolation:)` return `nil`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public mutating func next(isolation actor: isolated (any Actor)?) async throws(Failure) -> Base.Element? { if remaining != 0 { diff --git a/stdlib/public/Concurrency/AsyncPrefixWhileSequence.swift b/stdlib/public/Concurrency/AsyncPrefixWhileSequence.swift index 9573d8e46475f..69c20b89fbc5e 100644 --- a/stdlib/public/Concurrency/AsyncPrefixWhileSequence.swift +++ b/stdlib/public/Concurrency/AsyncPrefixWhileSequence.swift @@ -78,7 +78,7 @@ extension AsyncPrefixWhileSequence: AsyncSequence { /// /// The prefix-while sequence produces whatever type of error its /// base sequence does. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias Failure = Base.Failure /// The type of iterator that produces elements of the sequence. public typealias AsyncIterator = Iterator @@ -127,7 +127,7 @@ extension AsyncPrefixWhileSequence: AsyncSequence { /// from the base sequence and calls the predicate with it. If this call /// succeeds, this method passes along the element. Otherwise, it returns /// `nil`, ending the sequence. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public mutating func next(isolation actor: isolated (any Actor)?) async throws(Failure) -> Base.Element? { if !predicateHasFailed, let nextElement = try await baseIterator.next(isolation: actor) { diff --git a/stdlib/public/Concurrency/AsyncSequence.swift b/stdlib/public/Concurrency/AsyncSequence.swift index 10c5db6b86843..9cab1863746be 100644 --- a/stdlib/public/Concurrency/AsyncSequence.swift +++ b/stdlib/public/Concurrency/AsyncSequence.swift @@ -80,7 +80,7 @@ public protocol AsyncSequence { associatedtype Element /// The type of errors produced when iteration over the sequence fails. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) associatedtype Failure: Error = AsyncIterator.Failure where AsyncIterator.Failure == Failure diff --git a/stdlib/public/Concurrency/AsyncStream.swift b/stdlib/public/Concurrency/AsyncStream.swift index f8e0d413083b0..07de09db4a62b 100644 --- a/stdlib/public/Concurrency/AsyncStream.swift +++ b/stdlib/public/Concurrency/AsyncStream.swift @@ -391,7 +391,7 @@ extension AsyncStream: AsyncSequence { /// is awaiting a value, the `AsyncStream` terminates. In this case, /// `next()` might return `nil` immediately, or return `nil` on /// subsequent calls. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public mutating func next(isolation actor: isolated (any Actor)?) async -> Element? { await context.produce() } @@ -549,7 +549,7 @@ extension AsyncStream { fatalError("Unavailable in task-to-thread concurrency model") } - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @available(*, unavailable, message: "Unavailable in task-to-thread concurrency model") public mutating func next(isolation actor: isolated (any Actor)?) async -> Element? { fatalError("Unavailable in task-to-thread concurrency model") diff --git a/stdlib/public/Concurrency/AsyncThrowingCompactMapSequence.swift b/stdlib/public/Concurrency/AsyncThrowingCompactMapSequence.swift index 76aa3898717cc..a4722402bae8f 100644 --- a/stdlib/public/Concurrency/AsyncThrowingCompactMapSequence.swift +++ b/stdlib/public/Concurrency/AsyncThrowingCompactMapSequence.swift @@ -160,7 +160,7 @@ extension AsyncThrowingCompactMapSequence: AsyncSequence { /// this method continues to wait for further elements until it gets one /// that transforms to a non-`nil` value. If calling the closure throws an /// error, the sequence ends and `next()` rethrows the error. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public mutating func next(isolation actor: isolated (any Actor)?) async throws(Failure) -> ElementOfResult? { while !finished { diff --git a/stdlib/public/Concurrency/AsyncThrowingDropWhileSequence.swift b/stdlib/public/Concurrency/AsyncThrowingDropWhileSequence.swift index a56c2546e1f02..669af6095e14e 100644 --- a/stdlib/public/Concurrency/AsyncThrowingDropWhileSequence.swift +++ b/stdlib/public/Concurrency/AsyncThrowingDropWhileSequence.swift @@ -164,7 +164,7 @@ extension AsyncThrowingDropWhileSequence: AsyncSequence { /// received from its base iterator as-is, and never executes the predicate /// closure again. If calling the closure throws an error, the sequence /// ends and `next(isolation:)` rethrows the error. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public mutating func next(isolation actor: isolated (any Actor)?) async throws(Failure) -> Base.Element? { while !finished && !doneDropping { diff --git a/stdlib/public/Concurrency/AsyncThrowingFilterSequence.swift b/stdlib/public/Concurrency/AsyncThrowingFilterSequence.swift index 32c2fb98672c0..0ae98180c7381 100644 --- a/stdlib/public/Concurrency/AsyncThrowingFilterSequence.swift +++ b/stdlib/public/Concurrency/AsyncThrowingFilterSequence.swift @@ -145,7 +145,7 @@ extension AsyncThrowingFilterSequence: AsyncSequence { /// otherwise it awaits the next element from the base iterator. If calling /// the closure throws an error, the sequence ends and `next(isolation:)` /// rethrows the error. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public mutating func next(isolation actor: isolated (any Actor)?) async throws(Failure) -> Base.Element? { while !finished { diff --git a/stdlib/public/Concurrency/AsyncThrowingFlatMapSequence.swift b/stdlib/public/Concurrency/AsyncThrowingFlatMapSequence.swift index fbcec7062237b..97f399f5d6073 100644 --- a/stdlib/public/Concurrency/AsyncThrowingFlatMapSequence.swift +++ b/stdlib/public/Concurrency/AsyncThrowingFlatMapSequence.swift @@ -179,7 +179,7 @@ extension AsyncThrowingFlatMapSequence: AsyncSequence { /// from this iterator until it terminates. At this point, /// `next(isolation:)` is ready to receive the next value from the base /// sequence. If `transform` throws an error, the sequence terminates. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public mutating func next(isolation actor: isolated (any Actor)?) async throws(Failure) -> SegmentOfResult.Element? { while !finished { diff --git a/stdlib/public/Concurrency/AsyncThrowingMapSequence.swift b/stdlib/public/Concurrency/AsyncThrowingMapSequence.swift index d31e09612484c..744edb8286e4d 100644 --- a/stdlib/public/Concurrency/AsyncThrowingMapSequence.swift +++ b/stdlib/public/Concurrency/AsyncThrowingMapSequence.swift @@ -147,7 +147,7 @@ extension AsyncThrowingMapSequence: AsyncSequence { /// `next(isolation:)` returns the result of calling the transforming /// closure on the received element. If calling the closure throws an error, /// the sequence ends and `next(isolation:)` rethrows the error. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public mutating func next(isolation actor: isolated (any Actor)?) async throws(Failure) -> Transformed? { guard !finished, let element = try await baseIterator.next(isolation: actor) else { diff --git a/stdlib/public/Concurrency/AsyncThrowingPrefixWhileSequence.swift b/stdlib/public/Concurrency/AsyncThrowingPrefixWhileSequence.swift index 70ba250567733..e889949ec185e 100644 --- a/stdlib/public/Concurrency/AsyncThrowingPrefixWhileSequence.swift +++ b/stdlib/public/Concurrency/AsyncThrowingPrefixWhileSequence.swift @@ -146,7 +146,7 @@ extension AsyncThrowingPrefixWhileSequence: AsyncSequence { /// succeeds, this method passes along the element. Otherwise, it returns /// `nil`, ending the sequence. If calling the predicate closure throws an /// error, the sequence ends and `next(isolation:)` rethrows the error. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public mutating func next(isolation actor: isolated (any Actor)?) async throws(Failure) -> Base.Element? { if !predicateHasFailed, let nextElement = try await baseIterator.next(isolation: actor) { diff --git a/stdlib/public/Concurrency/AsyncThrowingStream.swift b/stdlib/public/Concurrency/AsyncThrowingStream.swift index e6c7537d4e429..7d44a8710f38f 100644 --- a/stdlib/public/Concurrency/AsyncThrowingStream.swift +++ b/stdlib/public/Concurrency/AsyncThrowingStream.swift @@ -429,7 +429,7 @@ extension AsyncThrowingStream: AsyncSequence { /// is awaiting a value, the `AsyncThrowingStream` terminates. In this case, /// `next()` may return `nil` immediately, or else return `nil` on /// subsequent calls. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public mutating func next(isolation actor: isolated (any Actor)?) async throws(Failure) -> Element? { return try await context.produce() } diff --git a/stdlib/public/Concurrency/TaskGroup.swift b/stdlib/public/Concurrency/TaskGroup.swift index 4a5be52f32595..54e65771e7063 100644 --- a/stdlib/public/Concurrency/TaskGroup.swift +++ b/stdlib/public/Concurrency/TaskGroup.swift @@ -1156,7 +1156,7 @@ extension ThrowingTaskGroup: AsyncSequence { /// /// - Returns: The value returned by the next child task that completes, /// or `nil` if there are no remaining child tasks, - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public mutating func next(isolation actor: isolated (any Actor)?) async throws(Failure) -> Element? { guard !finished else { return nil } do { diff --git a/stdlib/public/Distributed/DistributedActor.swift b/stdlib/public/Distributed/DistributedActor.swift index 649190e3d76e6..ed95c6e2039ee 100644 --- a/stdlib/public/Distributed/DistributedActor.swift +++ b/stdlib/public/Distributed/DistributedActor.swift @@ -408,7 +408,7 @@ extension DistributedActor { /// as only a local distributed actor can be isolated on and may be automatically /// erased to such `any Actor` when calling methods implicitly accepting the /// caller's actor isolation, e.g. by using the `#isolation` macro. - @backDeployed(before: SwiftStdlib 5.11) + @backDeployed(before: SwiftStdlib 6.0) public var asLocalActor: any Actor { Builtin.distributedActorAsAnyActor(self) } @@ -442,10 +442,10 @@ func _distributedActorRemoteInitialize(_ actorType: Builtin.RawPointer) -> Any // ==== Distributed Actor Stubs ------------------------------------------------ -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) public protocol _DistributedActorStub where Self: DistributedActor {} -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) public func _distributedStubFatalError(function: String = #function) -> Never { fatalError("Unexpected invocation of distributed method '\(function)' stub!") } \ No newline at end of file diff --git a/stdlib/public/Distributed/DistributedActorSystem.swift b/stdlib/public/Distributed/DistributedActorSystem.swift index 44713724e94cc..4bb4b67d9cf90 100644 --- a/stdlib/public/Distributed/DistributedActorSystem.swift +++ b/stdlib/public/Distributed/DistributedActorSystem.swift @@ -467,7 +467,7 @@ extension DistributedActorSystem { let targetNameUTF8 = Array(targetName.utf8) let concreteTargetNameTypeNamePair: _SwiftNamePair? - if #available(SwiftStdlib 5.11, *) { + if #available(SwiftStdlib 6.0, *) { let dataAndLength = targetNameUTF8.withUnsafeBufferPointer { targetNameUTF8 in _getConcreteAccessibleWitnessName(on: actor, targetNameUTF8.baseAddress!, UInt(targetNameUTF8.endIndex)) diff --git a/stdlib/public/Distributed/DistributedMetadata.swift b/stdlib/public/Distributed/DistributedMetadata.swift index 39c8a75aaac9f..7d7e142133050 100644 --- a/stdlib/public/Distributed/DistributedMetadata.swift +++ b/stdlib/public/Distributed/DistributedMetadata.swift @@ -95,7 +95,7 @@ func __getReturnTypeInfo( /// uses to return String data/length pairs. typealias _SwiftNamePair = (UnsafePointer, Int) -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) @_silgen_name("swift_distributed_getConcreteAccessibleWitnessName") func _getConcreteAccessibleWitnessName( on actor: AnyObject, // : DistributedActor @@ -105,7 +105,7 @@ func _getConcreteAccessibleWitnessName( /// Retrieve a generic environment descriptor associated with /// the given distributed target. -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) @_silgen_name("swift_distributed_getGenericEnvironmentForConcreteActor") // SPI Distributed func _getGenericEnvironmentOfDistributedTarget( diff --git a/stdlib/public/Observation/Sources/Observation/ObservationTracking.swift b/stdlib/public/Observation/Sources/Observation/ObservationTracking.swift index 65727ee82e9c9..0530093f3a2bd 100644 --- a/stdlib/public/Observation/Sources/Observation/ObservationTracking.swift +++ b/stdlib/public/Observation/Sources/Observation/ObservationTracking.swift @@ -157,7 +157,7 @@ public struct ObservationTracking: Sendable { } } - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public var changed: AnyKeyPath? { state.withCriticalRegion { $0.changed } } diff --git a/stdlib/public/Synchronization/Atomic.swift b/stdlib/public/Synchronization/Atomic.swift index b0434d6ae0776..f12482aecd27e 100644 --- a/stdlib/public/Synchronization/Atomic.swift +++ b/stdlib/public/Synchronization/Atomic.swift @@ -13,19 +13,19 @@ import Builtin /// An atomic value. -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) @frozen @_rawLayout(like: Value.AtomicRepresentation) @_staticExclusiveOnly public struct Atomic: ~Copyable { - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent var address: UnsafeMutablePointer { UnsafeMutablePointer(rawAddress) } - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent var rawAddress: Builtin.RawPointer { @@ -35,7 +35,7 @@ public struct Atomic: ~Copyable { /// Initializes a value of this atomic with the given initial value. /// /// - Parameter initialValue: The initial value to set this atomic. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public init(_ initialValue: consuming Value) { @@ -44,7 +44,7 @@ public struct Atomic: ~Copyable { // Deinit's can't be marked @_transparent. Do these things need all of these // attributes..? - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @inlinable deinit { @@ -55,5 +55,5 @@ public struct Atomic: ~Copyable { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension Atomic: @unchecked Sendable where Value: Sendable {} diff --git a/stdlib/public/Synchronization/AtomicBool.swift b/stdlib/public/Synchronization/AtomicBool.swift index e82c5f0d429b5..b12e8fef4f3e4 100644 --- a/stdlib/public/Synchronization/AtomicBool.swift +++ b/stdlib/public/Synchronization/AtomicBool.swift @@ -16,11 +16,11 @@ import Builtin // Bool AtomicRepresentable conformance //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension Bool: AtomicRepresentable { /// The storage representation type that `Self` encodes to and decodes from /// which is a suitable type when used in atomic operations. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = UInt8.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicRepresentation` storage @@ -33,7 +33,7 @@ extension Bool: AtomicRepresentable { /// - Parameter value: A valid instance of `Self` that's about to be destroyed /// to encode an instance of its `AtomicRepresentation`. /// - Returns: The newly encoded `AtomicRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicRepresentation( @@ -54,7 +54,7 @@ extension Bool: AtomicRepresentable { /// - Parameter storage: The storage representation for `Self` that's used /// within atomic operations. /// - Returns: The newly decoded logical type `Self`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicRepresentation( @@ -70,7 +70,7 @@ extension Bool: AtomicRepresentable { // Bool atomic operations //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension Atomic where Value == Bool { /// Perform an atomic logical AND operation and return the old and new value, /// applying the specified memory ordering. @@ -79,7 +79,7 @@ extension Atomic where Value == Bool { /// - Parameter ordering: The memory ordering to apply on this operation. /// - Returns: A tuple with the old value before the operation a the new value /// after the operation. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @discardableResult @_semantics("atomics.requires_constant_orderings") @_alwaysEmitIntoClient @@ -137,7 +137,7 @@ extension Atomic where Value == Bool { /// - Parameter ordering: The memory ordering to apply on this operation. /// - Returns: A tuple with the old value before the operation a the new value /// after the operation. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @discardableResult @_semantics("atomics.requires_constant_orderings") @_alwaysEmitIntoClient @@ -195,7 +195,7 @@ extension Atomic where Value == Bool { /// - Parameter ordering: The memory ordering to apply on this operation. /// - Returns: A tuple with the old value before the operation a the new value /// after the operation. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @discardableResult @_semantics("atomics.requires_constant_orderings") @_alwaysEmitIntoClient diff --git a/stdlib/public/Synchronization/AtomicFloats.swift b/stdlib/public/Synchronization/AtomicFloats.swift index acbfddc8640da..4a2670a365f4c 100644 --- a/stdlib/public/Synchronization/AtomicFloats.swift +++ b/stdlib/public/Synchronization/AtomicFloats.swift @@ -16,11 +16,11 @@ #if !((os(macOS) || targetEnvironment(macCatalyst)) && arch(x86_64)) -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension Float16: AtomicRepresentable { /// The storage representation type that `Self` encodes to and decodes from /// which is a suitable type when used in atomic operations. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = UInt16.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicRepresentation` storage @@ -33,7 +33,7 @@ extension Float16: AtomicRepresentable { /// - Parameter value: A valid instance of `Self` that's about to be destroyed /// to encode an instance of its `AtomicRepresentation`. /// - Returns: The newly encoded `AtomicRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicRepresentation( @@ -52,7 +52,7 @@ extension Float16: AtomicRepresentable { /// - Parameter storage: The storage representation for `Self` that's used /// within atomic operations. /// - Returns: The newly decoded logical type `Self`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicRepresentation( @@ -68,11 +68,11 @@ extension Float16: AtomicRepresentable { // Float AtomicRepresentable conformance //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension Float: AtomicRepresentable { /// The storage representation type that `Self` encodes to and decodes from /// which is a suitable type when used in atomic operations. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = UInt32.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicRepresentation` storage @@ -85,7 +85,7 @@ extension Float: AtomicRepresentable { /// - Parameter value: A valid instance of `Self` that's about to be destroyed /// to encode an instance of its `AtomicRepresentation`. /// - Returns: The newly encoded `AtomicRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicRepresentation( @@ -104,7 +104,7 @@ extension Float: AtomicRepresentable { /// - Parameter storage: The storage representation for `Self` that's used /// within atomic operations. /// - Returns: The newly decoded logical type `Self`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicRepresentation( @@ -120,11 +120,11 @@ extension Float: AtomicRepresentable { #if (_pointerBitWidth(_32) && _hasAtomicBitWidth(_64)) || _pointerBitWidth(_64) -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension Double: AtomicRepresentable { /// The storage representation type that `Self` encodes to and decodes from /// which is a suitable type when used in atomic operations. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = UInt64.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicRepresentation` storage @@ -137,7 +137,7 @@ extension Double: AtomicRepresentable { /// - Parameter value: A valid instance of `Self` that's about to be destroyed /// to encode an instance of its `AtomicRepresentation`. /// - Returns: The newly encoded `AtomicRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicRepresentation( @@ -156,7 +156,7 @@ extension Double: AtomicRepresentable { /// - Parameter storage: The storage representation for `Self` that's used /// within atomic operations. /// - Returns: The newly decoded logical type `Self`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicRepresentation( diff --git a/stdlib/public/Synchronization/AtomicIntegers.swift.gyb b/stdlib/public/Synchronization/AtomicIntegers.swift.gyb index 6d446d6c0843a..7cb0db2ae080f 100644 --- a/stdlib/public/Synchronization/AtomicIntegers.swift.gyb +++ b/stdlib/public/Synchronization/AtomicIntegers.swift.gyb @@ -24,22 +24,22 @@ import Builtin #if (_pointerBitWidth(_32) && _hasAtomicBitWidth(_64)) || _pointerBitWidth(_64) % end -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension ${intType}: AtomicRepresentable { /// The storage representation type that `Self` encodes to and decodes from /// which is a suitable type when used in atomic operations. % if intType == "Int" or intType == "UInt": #if _pointerBitWidth(_64) - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = _Atomic64BitStorage #elseif _pointerBitWidth(_32) - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = _Atomic32BitStorage #else #error("Unsupported platform") #endif % else: - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = ${intStorage} % end @@ -53,7 +53,7 @@ extension ${intType}: AtomicRepresentable { /// - Parameter value: A valid instance of `Self` that's about to be destroyed /// to encode an instance of its `AtomicRepresentation`. /// - Returns: The newly encoded `AtomicRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicRepresentation( @@ -72,7 +72,7 @@ extension ${intType}: AtomicRepresentable { /// - Parameter storage: The storage representation for `Self` that's used /// within atomic operations. /// - Returns: The newly decoded logical type `Self`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicRepresentation( @@ -86,7 +86,7 @@ extension ${intType}: AtomicRepresentable { // ${intType} atomic operations //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension Atomic where Value == ${intType} { % for (name, builtinName, op, doc) in integerOperations: /// Perform an atomic ${doc} operation and return the old and new value, @@ -101,7 +101,7 @@ extension Atomic where Value == ${intType} { /// - Parameter ordering: The memory ordering to apply on this operation. /// - Returns: A tuple containing the original value before the operation and /// the new value after the operation. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @discardableResult @_semantics("atomics.requires_constant_orderings") @_alwaysEmitIntoClient @@ -163,7 +163,7 @@ extension Atomic where Value == ${intType} { /// - Parameter ordering: The memory ordering to apply on this operation. /// - Returns: A tuple containing the original value before the operation and /// the new value after the operation. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @discardableResult @_semantics("atomics.requires_constant_orderings") @_alwaysEmitIntoClient @@ -202,7 +202,7 @@ extension Atomic where Value == ${intType} { /// - Parameter ordering: The memory ordering to apply on this operation. /// - Returns: A tuple containing the original value before the operation and /// the new value after the operation. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @discardableResult @_semantics("atomics.requires_constant_orderings") @_alwaysEmitIntoClient diff --git a/stdlib/public/Synchronization/AtomicLazyReference.swift b/stdlib/public/Synchronization/AtomicLazyReference.swift index 1eded6e1ba8f7..832bb8b3222de 100644 --- a/stdlib/public/Synchronization/AtomicLazyReference.swift +++ b/stdlib/public/Synchronization/AtomicLazyReference.swift @@ -14,14 +14,14 @@ /// /// These values can be set (initialized) exactly once, but read many /// times. -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) @frozen @_staticExclusiveOnly public struct AtomicLazyReference: ~Copyable { @usableFromInline let storage: Atomic?> - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public init() { storage = Atomic?>(nil) @@ -35,7 +35,7 @@ public struct AtomicLazyReference: ~Copyable { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension AtomicLazyReference { /// Atomically initializes this reference if its current value is nil, then /// returns the initialized value. If this reference is already initialized, @@ -66,7 +66,7 @@ extension AtomicLazyReference { /// - Returns: The value of `Instance` that was successfully stored within the /// lazy reference. This may or may not be the same value of `Instance` that /// was passed to this function. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public func storeIfNil(_ desired: consuming Instance) -> Instance { let desiredUnmanaged = Unmanaged.passRetained(desired) let (exchanged, current) = storage.compareExchange( @@ -92,12 +92,12 @@ extension AtomicLazyReference { /// /// - Returns: A value of `Instance` if the lazy reference was written to, or /// `nil` if it has not been written to yet. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public func load() -> Instance? { let value = storage.load(ordering: .acquiring) return value?.takeUnretainedValue() } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension AtomicLazyReference: @unchecked Sendable where Instance: Sendable {} diff --git a/stdlib/public/Synchronization/AtomicMemoryOrderings.swift b/stdlib/public/Synchronization/AtomicMemoryOrderings.swift index 79fd27ad06c2c..4eeba05e878bc 100644 --- a/stdlib/public/Synchronization/AtomicMemoryOrderings.swift +++ b/stdlib/public/Synchronization/AtomicMemoryOrderings.swift @@ -17,13 +17,13 @@ import Builtin //===----------------------------------------------------------------------===// /// Specifies the memory ordering semantics of an atomic load operation. -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) @frozen public struct AtomicLoadOrdering { @usableFromInline internal var _rawValue: Int - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable @_semantics("constant_evaluable") @_transparent @@ -32,7 +32,7 @@ public struct AtomicLoadOrdering { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension AtomicLoadOrdering { // FIXME: Explain these ordering levels in more detail. @@ -40,7 +40,7 @@ extension AtomicLoadOrdering { /// but imposes no ordering constraints on any other variable accesses. /// /// This value corresponds to `std::memory_order_relaxed` in C++. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_semantics("constant_evaluable") @_alwaysEmitIntoClient @_transparent @@ -54,7 +54,7 @@ extension AtomicLoadOrdering { /// acquiring thread happen after the atomic operation itself. /// /// This value corresponds to `std::memory_order_acquire` in C++. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_semantics("constant_evaluable") @_alwaysEmitIntoClient @_transparent @@ -68,7 +68,7 @@ extension AtomicLoadOrdering { /// in a single, total sequential ordering. /// /// This value corresponds to `std::memory_order_seq_cst` in C++. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_semantics("constant_evaluable") @_alwaysEmitIntoClient @_transparent @@ -77,27 +77,27 @@ extension AtomicLoadOrdering { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension AtomicLoadOrdering: Equatable { - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_transparent public static func ==(left: Self, right: Self) -> Bool { left._rawValue == right._rawValue } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension AtomicLoadOrdering: Hashable { - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public func hash(into hasher: inout Hasher) { hasher.combine(_rawValue) } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension AtomicLoadOrdering: CustomStringConvertible { - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public var description: String { switch self { case .relaxed: return "relaxed" @@ -113,13 +113,13 @@ extension AtomicLoadOrdering: CustomStringConvertible { //===----------------------------------------------------------------------===// /// Specifies the memory ordering semantics of an atomic store operation. -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) @frozen public struct AtomicStoreOrdering { @usableFromInline internal var _rawValue: Int - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable @_semantics("constant_evaluable") @_transparent @@ -128,7 +128,7 @@ public struct AtomicStoreOrdering { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension AtomicStoreOrdering { // FIXME: Explain these ordering levels in more detail. @@ -136,7 +136,7 @@ extension AtomicStoreOrdering { /// but imposes no ordering constraints on any other variable accesses. /// /// This value corresponds to `std::memory_order_relaxed` in C++. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_semantics("constant_evaluable") @_alwaysEmitIntoClient @_transparent @@ -150,7 +150,7 @@ extension AtomicStoreOrdering { /// the releasing thread happen before the atomic operation itself. /// /// This value corresponds to `std::memory_order_release` in C++. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_semantics("constant_evaluable") @_alwaysEmitIntoClient @_transparent @@ -164,7 +164,7 @@ extension AtomicStoreOrdering { /// in a single, total sequential ordering. /// /// This value corresponds to `std::memory_order_seq_cst` in C++. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_semantics("constant_evaluable") @_alwaysEmitIntoClient @_transparent @@ -173,7 +173,7 @@ extension AtomicStoreOrdering { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension AtomicStoreOrdering: Equatable { @_transparent public static func ==(left: Self, right: Self) -> Bool { @@ -181,18 +181,18 @@ extension AtomicStoreOrdering: Equatable { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension AtomicStoreOrdering: Hashable { - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public func hash(into hasher: inout Hasher) { hasher.combine(_rawValue) } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension AtomicStoreOrdering: CustomStringConvertible { - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public var description: String { switch self { case .relaxed: return "relaxed" @@ -209,13 +209,13 @@ extension AtomicStoreOrdering: CustomStringConvertible { /// Specifies the memory ordering semantics of an atomic read-modify-write /// operation. -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) @frozen public struct AtomicUpdateOrdering { @usableFromInline internal var _rawValue: Int - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable @_semantics("constant_evaluable") @_transparent @@ -224,7 +224,7 @@ public struct AtomicUpdateOrdering { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension AtomicUpdateOrdering { // FIXME: Explain these ordering levels in more detail. @@ -232,7 +232,7 @@ extension AtomicUpdateOrdering { /// but imposes no ordering constraints on any other variable accesses. /// /// This value corresponds to `std::memory_order_relaxed` in C++. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_semantics("constant_evaluable") @_alwaysEmitIntoClient @_transparent @@ -246,7 +246,7 @@ extension AtomicUpdateOrdering { /// the acquring thread happen after the atomic operation itself. /// /// This value corresponds to `std::memory_order_acquire` in C++. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_semantics("constant_evaluable") @_alwaysEmitIntoClient @_transparent @@ -260,7 +260,7 @@ extension AtomicUpdateOrdering { /// the releasing thread happen before the atomic operation itself. /// /// This value corresponds to `std::memory_order_release` in C++. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_semantics("constant_evaluable") @_alwaysEmitIntoClient @_transparent @@ -272,7 +272,7 @@ extension AtomicUpdateOrdering { /// `.acquiring` and `.releasing` operation on the same variable. /// /// This value corresponds to `std::memory_order_acq_rel` in C++. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_semantics("constant_evaluable") @_alwaysEmitIntoClient @_transparent @@ -287,7 +287,7 @@ extension AtomicUpdateOrdering { /// ordering. /// /// This value corresponds to `std::memory_order_seq_cst` in C++. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_semantics("constant_evaluable") @_alwaysEmitIntoClient @_transparent @@ -296,27 +296,27 @@ extension AtomicUpdateOrdering { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension AtomicUpdateOrdering: Equatable { - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_transparent public static func ==(left: Self, right: Self) -> Bool { left._rawValue == right._rawValue } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension AtomicUpdateOrdering: Hashable { - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public func hash(into hasher: inout Hasher) { hasher.combine(_rawValue) } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension AtomicUpdateOrdering: CustomStringConvertible { - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public var description: String { switch self { case .relaxed: return "relaxed" @@ -329,9 +329,9 @@ extension AtomicUpdateOrdering: CustomStringConvertible { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension AtomicLoadOrdering { - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_semantics("constant_evaluable") @_semantics("atomics.requires_constant_orderings") @_alwaysEmitIntoClient @@ -375,7 +375,7 @@ extension AtomicLoadOrdering { /// /// Be aware that Thread Sanitizer does not support fences and may report /// false-positive races for data protected by a fence. -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) @_semantics("atomics.requires_constant_orderings") @_alwaysEmitIntoClient @_transparent diff --git a/stdlib/public/Synchronization/AtomicOptional.swift b/stdlib/public/Synchronization/AtomicOptional.swift index ddd8cf2dcac90..2390696fa9825 100644 --- a/stdlib/public/Synchronization/AtomicOptional.swift +++ b/stdlib/public/Synchronization/AtomicOptional.swift @@ -13,7 +13,7 @@ /// An atomic value that also supports atomic operations when wrapped /// in an `Optional`. Atomic optional representable types come with a standalone /// atomic representation for their optional-wrapped variants. -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) public protocol AtomicOptionalRepresentable: AtomicRepresentable { /// The storage representation type that encodes to and decodes from /// `Optional` which is a suitable type when used in atomic operations @@ -54,7 +54,7 @@ public protocol AtomicOptionalRepresentable: AtomicRepresentable { // RawRepresentable AtomicOptionalRepresentable conformance //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension RawRepresentable where Self: AtomicOptionalRepresentable, @@ -63,7 +63,7 @@ where /// The storage representation type that encodes to and decodes from /// `Optional` which is a suitable type when used in atomic operations /// on `Optional`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicOptionalRepresentation = RawValue.AtomicOptionalRepresentation /// Destroys a value of `Self` and prepares an `AtomicOptionalRepresentation` @@ -76,7 +76,7 @@ where /// - Parameter value: An optional instance of `Self` that's about to be /// destroyed to encode an instance of its `AtomicOptionalRepresentation`. /// - Returns: The newly encoded `AtomicOptionalRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicOptionalRepresentation( @@ -104,7 +104,7 @@ where /// - Parameter storage: The optional storage representation for `Self?` /// that's used within atomic operations on `Optional`. /// - Returns: The newly decoded logical type `Self?`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicOptionalRepresentation( @@ -120,11 +120,11 @@ where // Optional AtomicRepresentable conformance //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension Optional: AtomicRepresentable where Wrapped: AtomicOptionalRepresentable { /// The storage representation type that `Self` encodes to and decodes from /// which is a suitable type when used in atomic operations. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = Wrapped.AtomicOptionalRepresentation /// Destroys a value of `Self` and prepares an `AtomicRepresentation` storage @@ -137,7 +137,7 @@ extension Optional: AtomicRepresentable where Wrapped: AtomicOptionalRepresentab /// - Parameter value: A valid instance of `Self` that's about to be destroyed /// to encode an instance of its `AtomicRepresentation`. /// - Returns: The newly encoded `AtomicRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicRepresentation( @@ -156,7 +156,7 @@ extension Optional: AtomicRepresentable where Wrapped: AtomicOptionalRepresentab /// - Parameter storage: The storage representation for `Self` that's used /// within atomic operations. /// - Returns: The newly decoded logical type `Self`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicRepresentation( diff --git a/stdlib/public/Synchronization/AtomicPointers.swift b/stdlib/public/Synchronization/AtomicPointers.swift index 4954a8b39ff4c..93e3a5855b8e5 100644 --- a/stdlib/public/Synchronization/AtomicPointers.swift +++ b/stdlib/public/Synchronization/AtomicPointers.swift @@ -14,11 +14,11 @@ // UnsafePointer AtomicRepresentable and AtomicOptionalRepresentable conformance //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension UnsafePointer: AtomicRepresentable { /// The storage representation type that `Self` encodes to and decodes from /// which is a suitable type when used in atomic operations. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = Int.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicRepresentation` storage @@ -31,7 +31,7 @@ extension UnsafePointer: AtomicRepresentable { /// - Parameter value: A valid instance of `Self` that's about to be destroyed /// to encode an instance of its `AtomicRepresentation`. /// - Returns: The newly encoded `AtomicRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicRepresentation( @@ -52,7 +52,7 @@ extension UnsafePointer: AtomicRepresentable { /// - Parameter storage: The storage representation for `Self` that's used /// within atomic operations. /// - Returns: The newly decoded logical type `Self`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicRepresentation( @@ -64,12 +64,12 @@ extension UnsafePointer: AtomicRepresentable { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension UnsafePointer: AtomicOptionalRepresentable { /// The storage representation type that encodes to and decodes from /// `Optional` which is a suitable type when used in atomic operations /// on `Optional`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicOptionalRepresentation = Int.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicOptionalRepresentation` @@ -82,7 +82,7 @@ extension UnsafePointer: AtomicOptionalRepresentable { /// - Parameter value: An optional instance of `Self` that's about to be /// destroyed to encode an instance of its `AtomicOptionalRepresentation`. /// - Returns: The newly encoded `AtomicOptionalRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicOptionalRepresentation( @@ -104,7 +104,7 @@ extension UnsafePointer: AtomicOptionalRepresentable { /// - Parameter storage: The optional storage representation for `Self?` /// that's used within atomic operations on `Optional`. /// - Returns: The newly decoded logical type `Self?`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicOptionalRepresentation( @@ -120,11 +120,11 @@ extension UnsafePointer: AtomicOptionalRepresentable { // UnsafeMutablePointer AtomicRepresentable and AtomicOptionalRepresentable conformance //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension UnsafeMutablePointer: AtomicRepresentable { /// The storage representation type that `Self` encodes to and decodes from /// which is a suitable type when used in atomic operations. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = Int.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicRepresentation` storage @@ -137,7 +137,7 @@ extension UnsafeMutablePointer: AtomicRepresentable { /// - Parameter value: A valid instance of `Self` that's about to be destroyed /// to encode an instance of its `AtomicRepresentation`. /// - Returns: The newly encoded `AtomicRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicRepresentation( @@ -158,7 +158,7 @@ extension UnsafeMutablePointer: AtomicRepresentable { /// - Parameter storage: The storage representation for `Self` that's used /// within atomic operations. /// - Returns: The newly decoded logical type `Self`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicRepresentation( @@ -170,12 +170,12 @@ extension UnsafeMutablePointer: AtomicRepresentable { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension UnsafeMutablePointer: AtomicOptionalRepresentable { /// The storage representation type that encodes to and decodes from /// `Optional` which is a suitable type when used in atomic operations /// on `Optional`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicOptionalRepresentation = Int.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicOptionalRepresentation` @@ -188,7 +188,7 @@ extension UnsafeMutablePointer: AtomicOptionalRepresentable { /// - Parameter value: An optional instance of `Self` that's about to be /// destroyed to encode an instance of its `AtomicOptionalRepresentation`. /// - Returns: The newly encoded `AtomicOptionalRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicOptionalRepresentation( @@ -210,7 +210,7 @@ extension UnsafeMutablePointer: AtomicOptionalRepresentable { /// - Parameter storage: The optional storage representation for `Self?` /// that's used within atomic operations on `Optional`. /// - Returns: The newly decoded logical type `Self?`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicOptionalRepresentation( @@ -226,11 +226,11 @@ extension UnsafeMutablePointer: AtomicOptionalRepresentable { // UnsafeRawPointer AtomicRepresentable and AtomicOptionalRepresentable conformance //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension UnsafeRawPointer: AtomicRepresentable { /// The storage representation type that `Self` encodes to and decodes from /// which is a suitable type when used in atomic operations. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = Int.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicRepresentation` storage @@ -243,7 +243,7 @@ extension UnsafeRawPointer: AtomicRepresentable { /// - Parameter value: A valid instance of `Self` that's about to be destroyed /// to encode an instance of its `AtomicRepresentation`. /// - Returns: The newly encoded `AtomicRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicRepresentation( @@ -264,7 +264,7 @@ extension UnsafeRawPointer: AtomicRepresentable { /// - Parameter storage: The storage representation for `Self` that's used /// within atomic operations. /// - Returns: The newly decoded logical type `Self`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicRepresentation( @@ -276,12 +276,12 @@ extension UnsafeRawPointer: AtomicRepresentable { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension UnsafeRawPointer: AtomicOptionalRepresentable { /// The storage representation type that encodes to and decodes from /// `Optional` which is a suitable type when used in atomic operations /// on `Optional`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicOptionalRepresentation = Int.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicOptionalRepresentation` @@ -294,7 +294,7 @@ extension UnsafeRawPointer: AtomicOptionalRepresentable { /// - Parameter value: An optional instance of `Self` that's about to be /// destroyed to encode an instance of its `AtomicOptionalRepresentation`. /// - Returns: The newly encoded `AtomicOptionalRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicOptionalRepresentation( @@ -316,7 +316,7 @@ extension UnsafeRawPointer: AtomicOptionalRepresentable { /// - Parameter storage: The optional storage representation for `Self?` /// that's used within atomic operations on `Optional`. /// - Returns: The newly decoded logical type `Self?`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicOptionalRepresentation( @@ -332,11 +332,11 @@ extension UnsafeRawPointer: AtomicOptionalRepresentable { // UnsafeMutableRawPointer AtomicRepresentable and AtomicOptionalRepresentable conformance //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension UnsafeMutableRawPointer: AtomicRepresentable { /// The storage representation type that `Self` encodes to and decodes from /// which is a suitable type when used in atomic operations. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = Int.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicRepresentation` storage @@ -349,7 +349,7 @@ extension UnsafeMutableRawPointer: AtomicRepresentable { /// - Parameter value: A valid instance of `Self` that's about to be destroyed /// to encode an instance of its `AtomicRepresentation`. /// - Returns: The newly encoded `AtomicRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicRepresentation( @@ -370,7 +370,7 @@ extension UnsafeMutableRawPointer: AtomicRepresentable { /// - Parameter storage: The storage representation for `Self` that's used /// within atomic operations. /// - Returns: The newly decoded logical type `Self`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicRepresentation( @@ -382,12 +382,12 @@ extension UnsafeMutableRawPointer: AtomicRepresentable { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension UnsafeMutableRawPointer: AtomicOptionalRepresentable { /// The storage representation type that encodes to and decodes from /// `Optional` which is a suitable type when used in atomic operations /// on `Optional`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicOptionalRepresentation = Int.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicOptionalRepresentation` @@ -400,7 +400,7 @@ extension UnsafeMutableRawPointer: AtomicOptionalRepresentable { /// - Parameter value: An optional instance of `Self` that's about to be /// destroyed to encode an instance of its `AtomicOptionalRepresentation`. /// - Returns: The newly encoded `AtomicOptionalRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicOptionalRepresentation( @@ -422,7 +422,7 @@ extension UnsafeMutableRawPointer: AtomicOptionalRepresentable { /// - Parameter storage: The optional storage representation for `Self?` /// that's used within atomic operations on `Optional`. /// - Returns: The newly decoded logical type `Self?`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicOptionalRepresentation( @@ -438,11 +438,11 @@ extension UnsafeMutableRawPointer: AtomicOptionalRepresentable { // Unmanaged AtomicRepresentable and AtomicOptionalRepresentable conformance //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension Unmanaged: AtomicRepresentable { /// The storage representation type that `Self` encodes to and decodes from /// which is a suitable type when used in atomic operations. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = Int.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicRepresentation` storage @@ -455,7 +455,7 @@ extension Unmanaged: AtomicRepresentable { /// - Parameter value: A valid instance of `Self` that's about to be destroyed /// to encode an instance of its `AtomicRepresentation`. /// - Returns: The newly encoded `AtomicRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicRepresentation( @@ -476,7 +476,7 @@ extension Unmanaged: AtomicRepresentable { /// - Parameter storage: The storage representation for `Self` that's used /// within atomic operations. /// - Returns: The newly decoded logical type `Self`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicRepresentation( @@ -488,12 +488,12 @@ extension Unmanaged: AtomicRepresentable { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension Unmanaged: AtomicOptionalRepresentable { /// The storage representation type that encodes to and decodes from /// `Optional` which is a suitable type when used in atomic operations /// on `Optional`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicOptionalRepresentation = Int.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicOptionalRepresentation` @@ -506,7 +506,7 @@ extension Unmanaged: AtomicOptionalRepresentable { /// - Parameter value: An optional instance of `Self` that's about to be /// destroyed to encode an instance of its `AtomicOptionalRepresentation`. /// - Returns: The newly encoded `AtomicOptionalRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicOptionalRepresentation( @@ -536,7 +536,7 @@ extension Unmanaged: AtomicOptionalRepresentable { /// - Parameter storage: The optional storage representation for `Self?` /// that's used within atomic operations on `Optional`. /// - Returns: The newly decoded logical type `Self?`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicOptionalRepresentation( @@ -552,11 +552,11 @@ extension Unmanaged: AtomicOptionalRepresentable { // OpaquePointer AtomicRepresentable and AtomicOptionalRepresentable conformance //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension OpaquePointer: AtomicRepresentable { /// The storage representation type that `Self` encodes to and decodes from /// which is a suitable type when used in atomic operations. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = Int.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicRepresentation` storage @@ -569,7 +569,7 @@ extension OpaquePointer: AtomicRepresentable { /// - Parameter value: A valid instance of `Self` that's about to be destroyed /// to encode an instance of its `AtomicRepresentation`. /// - Returns: The newly encoded `AtomicRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicRepresentation( @@ -590,7 +590,7 @@ extension OpaquePointer: AtomicRepresentable { /// - Parameter storage: The storage representation for `Self` that's used /// within atomic operations. /// - Returns: The newly decoded logical type `Self`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicRepresentation( @@ -602,12 +602,12 @@ extension OpaquePointer: AtomicRepresentable { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension OpaquePointer: AtomicOptionalRepresentable { /// The storage representation type that encodes to and decodes from /// `Optional` which is a suitable type when used in atomic operations /// on `Optional`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicOptionalRepresentation = Int.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicOptionalRepresentation` @@ -620,7 +620,7 @@ extension OpaquePointer: AtomicOptionalRepresentable { /// - Parameter value: An optional instance of `Self` that's about to be /// destroyed to encode an instance of its `AtomicOptionalRepresentation`. /// - Returns: The newly encoded `AtomicOptionalRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicOptionalRepresentation( @@ -642,7 +642,7 @@ extension OpaquePointer: AtomicOptionalRepresentable { /// - Parameter storage: The optional storage representation for `Self?` /// that's used within atomic operations on `Optional`. /// - Returns: The newly decoded logical type `Self?`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicOptionalRepresentation( @@ -658,11 +658,11 @@ extension OpaquePointer: AtomicOptionalRepresentable { // ObjectIdentifier AtomicRepresentable and AtomicOptionalRepresentable conformance //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension ObjectIdentifier: AtomicRepresentable { /// The storage representation type that `Self` encodes to and decodes from /// which is a suitable type when used in atomic operations. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = Int.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicRepresentation` storage @@ -675,7 +675,7 @@ extension ObjectIdentifier: AtomicRepresentable { /// - Parameter value: A valid instance of `Self` that's about to be destroyed /// to encode an instance of its `AtomicRepresentation`. /// - Returns: The newly encoded `AtomicRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicRepresentation( @@ -696,7 +696,7 @@ extension ObjectIdentifier: AtomicRepresentable { /// - Parameter storage: The storage representation for `Self` that's used /// within atomic operations. /// - Returns: The newly decoded logical type `Self`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicRepresentation( @@ -710,12 +710,12 @@ extension ObjectIdentifier: AtomicRepresentable { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension ObjectIdentifier: AtomicOptionalRepresentable { /// The storage representation type that encodes to and decodes from /// `Optional` which is a suitable type when used in atomic operations /// on `Optional`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicOptionalRepresentation = Int.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicOptionalRepresentation` @@ -728,7 +728,7 @@ extension ObjectIdentifier: AtomicOptionalRepresentable { /// - Parameter value: An optional instance of `Self` that's about to be /// destroyed to encode an instance of its `AtomicOptionalRepresentation`. /// - Returns: The newly encoded `AtomicOptionalRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicOptionalRepresentation( @@ -752,7 +752,7 @@ extension ObjectIdentifier: AtomicOptionalRepresentable { /// - Parameter storage: The optional storage representation for `Self?` /// that's used within atomic operations on `Optional`. /// - Returns: The newly decoded logical type `Self?`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicOptionalRepresentation( @@ -772,11 +772,11 @@ extension ObjectIdentifier: AtomicOptionalRepresentable { #if (_pointerBitWidth(_32) && _hasAtomicBitWidth(_64)) || (_pointerBitWidth(_64) && _hasAtomicBitWidth(_128)) -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension UnsafeBufferPointer: AtomicRepresentable { /// The storage representation type that `Self` encodes to and decodes from /// which is a suitable type when used in atomic operations. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = WordPair.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicRepresentation` storage @@ -789,7 +789,7 @@ extension UnsafeBufferPointer: AtomicRepresentable { /// - Parameter value: A valid instance of `Self` that's about to be destroyed /// to encode an instance of its `AtomicRepresentation`. /// - Returns: The newly encoded `AtomicRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicRepresentation( @@ -815,7 +815,7 @@ extension UnsafeBufferPointer: AtomicRepresentable { /// - Parameter storage: The storage representation for `Self` that's used /// within atomic operations. /// - Returns: The newly decoded logical type `Self`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicRepresentation( @@ -838,11 +838,11 @@ extension UnsafeBufferPointer: AtomicRepresentable { #if (_pointerBitWidth(_32) && _hasAtomicBitWidth(_64)) || (_pointerBitWidth(_64) && _hasAtomicBitWidth(_128)) -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension UnsafeMutableBufferPointer: AtomicRepresentable { /// The storage representation type that `Self` encodes to and decodes from /// which is a suitable type when used in atomic operations. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = WordPair.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicRepresentation` storage @@ -855,7 +855,7 @@ extension UnsafeMutableBufferPointer: AtomicRepresentable { /// - Parameter value: A valid instance of `Self` that's about to be destroyed /// to encode an instance of its `AtomicRepresentation`. /// - Returns: The newly encoded `AtomicRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicRepresentation( @@ -881,7 +881,7 @@ extension UnsafeMutableBufferPointer: AtomicRepresentable { /// - Parameter storage: The storage representation for `Self` that's used /// within atomic operations. /// - Returns: The newly decoded logical type `Self`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicRepresentation( @@ -904,11 +904,11 @@ extension UnsafeMutableBufferPointer: AtomicRepresentable { #if (_pointerBitWidth(_32) && _hasAtomicBitWidth(_64)) || (_pointerBitWidth(_64) && _hasAtomicBitWidth(_128)) -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension UnsafeRawBufferPointer: AtomicRepresentable { /// The storage representation type that `Self` encodes to and decodes from /// which is a suitable type when used in atomic operations. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = WordPair.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicRepresentation` storage @@ -921,7 +921,7 @@ extension UnsafeRawBufferPointer: AtomicRepresentable { /// - Parameter value: A valid instance of `Self` that's about to be destroyed /// to encode an instance of its `AtomicRepresentation`. /// - Returns: The newly encoded `AtomicRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicRepresentation( @@ -947,7 +947,7 @@ extension UnsafeRawBufferPointer: AtomicRepresentable { /// - Parameter storage: The storage representation for `Self` that's used /// within atomic operations. /// - Returns: The newly decoded logical type `Self`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicRepresentation( @@ -970,11 +970,11 @@ extension UnsafeRawBufferPointer: AtomicRepresentable { #if (_pointerBitWidth(_32) && _hasAtomicBitWidth(_64)) || (_pointerBitWidth(_64) && _hasAtomicBitWidth(_128)) -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension UnsafeMutableRawBufferPointer: AtomicRepresentable { /// The storage representation type that `Self` encodes to and decodes from /// which is a suitable type when used in atomic operations. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = WordPair.AtomicRepresentation /// Destroys a value of `Self` and prepares an `AtomicRepresentation` storage @@ -987,7 +987,7 @@ extension UnsafeMutableRawBufferPointer: AtomicRepresentable { /// - Parameter value: A valid instance of `Self` that's about to be destroyed /// to encode an instance of its `AtomicRepresentation`. /// - Returns: The newly encoded `AtomicRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicRepresentation( @@ -1013,7 +1013,7 @@ extension UnsafeMutableRawBufferPointer: AtomicRepresentable { /// - Parameter storage: The storage representation for `Self` that's used /// within atomic operations. /// - Returns: The newly decoded logical type `Self`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicRepresentation( diff --git a/stdlib/public/Synchronization/AtomicRepresentable.swift b/stdlib/public/Synchronization/AtomicRepresentable.swift index 6e16dba6f4d5e..bc22dce4e4d06 100644 --- a/stdlib/public/Synchronization/AtomicRepresentable.swift +++ b/stdlib/public/Synchronization/AtomicRepresentable.swift @@ -159,7 +159,7 @@ /// on platforms that support double wide atomics, but if they do it will be /// 128 bits wide on 64 bit systems and 64 bits wide on 32 bit systems. /// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) public protocol AtomicRepresentable { /// The storage representation type that `Self` encodes to and decodes from /// which is a suitable type when used in atomic operations. @@ -198,7 +198,7 @@ public protocol AtomicRepresentable { // RawRepresentable AtomicRepresentable conformance //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension RawRepresentable where Self: AtomicRepresentable, @@ -206,7 +206,7 @@ where { /// The storage representation type that `Self` encodes to and decodes from /// which is a suitable type when used in atomic operations. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = RawValue.AtomicRepresentation @@ -220,7 +220,7 @@ where /// - Parameter value: A valid instance of `Self` that's about to be destroyed /// to encode an instance of its `AtomicRepresentation`. /// - Returns: The newly encoded `AtomicRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicRepresentation( @@ -240,7 +240,7 @@ where /// - Parameter storage: The storage representation for `Self` that's used /// within atomic operations. /// - Returns: The newly decoded logical type `Self`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicRepresentation( @@ -254,11 +254,11 @@ where // Never AtomicRepresentable conformance //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension Never: AtomicRepresentable { /// The storage representation type that `Self` encodes to and decodes from /// which is a suitable type when used in atomic operations. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = Never @@ -272,7 +272,7 @@ extension Never: AtomicRepresentable { /// - Parameter value: A valid instance of `Self` that's about to be destroyed /// to encode an instance of its `AtomicRepresentation`. /// - Returns: The newly encoded `AtomicRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicRepresentation( @@ -290,7 +290,7 @@ extension Never: AtomicRepresentable { /// - Parameter storage: The storage representation for `Self` that's used /// within atomic operations. /// - Returns: The newly decoded logical type `Self`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicRepresentation( @@ -304,11 +304,11 @@ extension Never: AtomicRepresentable { #if _pointerBitWidth(_64) && _hasAtomicBitWidth(_128) -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension Duration: AtomicRepresentable { /// The storage representation type that `Self` encodes to and decodes from /// which is a suitable type when used in atomic operations. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public typealias AtomicRepresentation = WordPair.AtomicRepresentation @@ -322,7 +322,7 @@ extension Duration: AtomicRepresentable { /// - Parameter value: A valid instance of `Self` that's about to be destroyed /// to encode an instance of its `AtomicRepresentation`. /// - Returns: The newly encoded `AtomicRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicRepresentation( @@ -347,7 +347,7 @@ extension Duration: AtomicRepresentable { /// - Parameter storage: The storage representation for `Self` that's used /// within atomic operations. /// - Returns: The newly decoded logical type `Self`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicRepresentation( diff --git a/stdlib/public/Synchronization/AtomicStorage.swift.gyb b/stdlib/public/Synchronization/AtomicStorage.swift.gyb index 4300a2d2623da..91e5ff065095e 100644 --- a/stdlib/public/Synchronization/AtomicStorage.swift.gyb +++ b/stdlib/public/Synchronization/AtomicStorage.swift.gyb @@ -20,13 +20,13 @@ import Builtin // ${size} bit Atomic Storage //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) @frozen @_alignment(${alignment}) public struct ${type} { public var _storage: ${builtin} - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public init(_ _builtin: ${builtin}) { @@ -38,14 +38,14 @@ public struct ${type} { // ${size} bit atomic load //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension Atomic where Value.AtomicRepresentation == ${type} { /// Atomically loads and returns the current value, applying the specified /// memory ordering. /// /// - Parameter ordering: The memory ordering to apply on this operation. /// - Returns: The current value. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_semantics("atomics.requires_constant_orderings") @_alwaysEmitIntoClient @_transparent @@ -68,14 +68,14 @@ extension Atomic where Value.AtomicRepresentation == ${type} { // ${size} bit atomic store //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension Atomic where Value.AtomicRepresentation == ${type} { /// Atomically sets the current value to `desired`, applying the specified /// memory ordering. /// /// - Parameter desired: The desired new value. /// - Parameter ordering: The memory ordering to apply on this operation. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_semantics("atomics.requires_constant_orderings") @_alwaysEmitIntoClient @_transparent @@ -102,7 +102,7 @@ extension Atomic where Value.AtomicRepresentation == ${type} { // ${size} bit atomic exchanges //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension Atomic where Value.AtomicRepresentation == ${type} { /// Atomically sets the current value to `desired` and returns the original /// value, applying the specified memory ordering. @@ -110,7 +110,7 @@ extension Atomic where Value.AtomicRepresentation == ${type} { /// - Parameter desired: The desired new value. /// - Parameter ordering: The memory ordering to apply on this operation. /// - Returns: The original value. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_semantics("atomics.requires_constant_orderings") @_alwaysEmitIntoClient @_transparent @@ -140,7 +140,7 @@ extension Atomic where Value.AtomicRepresentation == ${type} { // ${size} bit atomic compare exchanges //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension Atomic where Value.AtomicRepresentation == ${type} { /// Perform an atomic compare and exchange operation on the current value, /// applying the specified memory ordering. @@ -163,7 +163,7 @@ extension Atomic where Value.AtomicRepresentation == ${type} { /// - Parameter ordering: The memory ordering to apply on this operation. /// - Returns: A tuple `(exchanged, original)`, where `exchanged` is true if /// the exchange was successful, and `original` is the original value. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_semantics("atomics.requires_constant_orderings") @_alwaysEmitIntoClient @_transparent @@ -181,7 +181,7 @@ extension Atomic where Value.AtomicRepresentation == ${type} { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension Atomic where Value.AtomicRepresentation == ${type} { /// Perform an atomic compare and exchange operation on the current value, /// applying the specified success/failure memory orderings. @@ -211,7 +211,7 @@ extension Atomic where Value.AtomicRepresentation == ${type} { /// operation does not perform the exchange. /// - Returns: A tuple `(exchanged, original)`, where `exchanged` is true if /// the exchange was successful, and `original` is the original value. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_semantics("atomics.requires_constant_orderings") @_alwaysEmitIntoClient @_transparent @@ -251,7 +251,7 @@ extension Atomic where Value.AtomicRepresentation == ${type} { // ${size} bit weak compare exchanges //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension Atomic where Value.AtomicRepresentation == ${type} { /// Perform an atomic weak compare and exchange operation on the current /// value, applying the memory ordering. This compare-exchange variant is @@ -283,7 +283,7 @@ extension Atomic where Value.AtomicRepresentation == ${type} { /// - Parameter ordering: The memory ordering to apply on this operation. /// - Returns: A tuple `(exchanged, original)`, where `exchanged` is true if /// the exchange was successful, and `original` is the original value. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_semantics("atomics.requires_constant_orderings") @_alwaysEmitIntoClient @_transparent @@ -301,7 +301,7 @@ extension Atomic where Value.AtomicRepresentation == ${type} { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension Atomic where Value.AtomicRepresentation == ${type} { /// Perform an atomic weak compare and exchange operation on the current /// value, applying the specified success/failure memory orderings. This @@ -341,7 +341,7 @@ extension Atomic where Value.AtomicRepresentation == ${type} { /// operation does not perform the exchange. /// - Returns: A tuple `(exchanged, original)`, where `exchanged` is true if /// the exchange was successful, and `original` is the original value. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_semantics("atomics.requires_constant_orderings") @_alwaysEmitIntoClient @_transparent diff --git a/stdlib/public/Synchronization/WordPair.swift b/stdlib/public/Synchronization/WordPair.swift index 46c85bb11c0c4..b7c7e71765dc6 100644 --- a/stdlib/public/Synchronization/WordPair.swift +++ b/stdlib/public/Synchronization/WordPair.swift @@ -40,7 +40,7 @@ import Builtin /// /// - Note: This type only conforms to `AtomicRepresentable` on platforms that /// support double wide atomics. -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) @frozen public struct WordPair { /// The first element in this word pair. @@ -53,7 +53,7 @@ public struct WordPair { /// /// - Parameter first: The first word to use in the pair. /// - Parameter second: The second word to use in the pair. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public init(first: UInt, second: UInt) { @@ -64,7 +64,7 @@ public struct WordPair { #if (_pointerBitWidth(_32) && _hasAtomicBitWidth(_64)) || (_pointerBitWidth(_64) && _hasAtomicBitWidth(_128)) -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension WordPair: AtomicRepresentable { #if _pointerBitWidth(_64) /// The storage representation type that `Self` encodes to and decodes from @@ -88,7 +88,7 @@ extension WordPair: AtomicRepresentable { /// - Parameter value: A valid instance of `Self` that's about to be destroyed /// to encode an instance of its `AtomicRepresentation`. /// - Returns: The newly encoded `AtomicRepresentation` storage. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func encodeAtomicRepresentation( @@ -125,7 +125,7 @@ extension WordPair: AtomicRepresentable { /// - Parameter storage: The storage representation for `Self` that's used /// within atomic operations. /// - Returns: The newly decoded logical type `Self`. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func decodeAtomicRepresentation( @@ -151,7 +151,7 @@ extension WordPair: AtomicRepresentable { #endif -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension WordPair: Equatable { /// Compares two values of this type to determine if they are equivalent to /// each other. @@ -159,7 +159,7 @@ extension WordPair: Equatable { /// - Parameter lhs: The first value to compare. /// - Parameter rhs: The second value to compare. /// - Returns: True if both values were equal, or false if they were unequal. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public static func ==(lhs: WordPair, rhs: WordPair) -> Bool { @@ -167,14 +167,14 @@ extension WordPair: Equatable { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension WordPair: Hashable { /// Hashes the essential components of this value by feeding them into the /// given hasher. /// /// - Parameter hasher: The hasher to use when combining the components /// of this instance. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @_alwaysEmitIntoClient @_transparent public func hash(into hasher: inout Hasher) { @@ -183,24 +183,24 @@ extension WordPair: Hashable { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension WordPair: CustomStringConvertible { /// A string that represents the contents of the word pair. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public var description: String { "WordPair(first: \(first), second: \(second))" } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension WordPair: CustomDebugStringConvertible { /// A string that represents the contents of the word pair, suitable for /// debugging. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public var debugDescription: String { "WordPair(first: \(first), second: \(second))" } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension WordPair: Sendable {} diff --git a/stdlib/public/core/Availability.swift b/stdlib/public/core/Availability.swift index e36cc4b71def3..eef9ec5cd2deb 100644 --- a/stdlib/public/core/Availability.swift +++ b/stdlib/public/core/Availability.swift @@ -102,10 +102,10 @@ extension _SwiftStdlibVersion { @_alwaysEmitIntoClient public static var v5_10_0: Self { Self(_value: 0x050A00) } @_alwaysEmitIntoClient - public static var v5_11_0: Self { Self(_value: 0x050B00) } + public static var v6_0_0: Self { Self(_value: 0x060000) } @available(SwiftStdlib 5.7, *) - public static var current: Self { .v5_11_0 } + public static var current: Self { .v6_0_0 } } @available(SwiftStdlib 5.7, *) diff --git a/stdlib/public/core/CollectionAlgorithms.swift b/stdlib/public/core/CollectionAlgorithms.swift index f528c113ed9a3..0a8cf4a847f97 100644 --- a/stdlib/public/core/CollectionAlgorithms.swift +++ b/stdlib/public/core/CollectionAlgorithms.swift @@ -232,7 +232,7 @@ extension Collection { /// returns `true`. /// /// - Complexity: O(*n*), where *n* is the length of the collection. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public func indices( where predicate: (Element) throws -> Bool @@ -269,7 +269,7 @@ extension Collection where Element: Equatable { /// `element`. /// /// - Complexity: O(*n*), where *n* is the length of the collection. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public func indices(of element: Element) -> RangeSet { indices(where: { $0 == element }) diff --git a/stdlib/public/core/DebuggerSupport.swift b/stdlib/public/core/DebuggerSupport.swift index 3587f44bf0ef3..4cb01ac0f5756 100644 --- a/stdlib/public/core/DebuggerSupport.swift +++ b/stdlib/public/core/DebuggerSupport.swift @@ -34,13 +34,13 @@ import SwiftShims /// "\(name) [\(wins)-\(losses)]" /// } /// } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) @attached(memberAttribute) public macro _DebugDescription() = #externalMacro(module: "SwiftMacros", type: "DebugDescriptionMacro") /// Internal-only macro. See `@_DebugDescription`. -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) @attached(peer, names: named(_lldb_summary)) public macro _DebugDescriptionProperty(_ debugIdentifier: String, _ computedProperties: [String]) = #externalMacro(module: "SwiftMacros", type: "_DebugDescriptionPropertyMacro") @@ -321,19 +321,19 @@ internal func _swift_unownedRetainCount(_: UnsafeMutableRawPointer) -> Int internal func _swift_weakRetainCount(_: UnsafeMutableRawPointer) -> Int // Utilities to get refcount(s) of class objects. -@backDeployed(before: SwiftStdlib 5.11) +@backDeployed(before: SwiftStdlib 6.0) public func _getRetainCount(_ object: AnyObject) -> UInt { let count = _withHeapObject(of: object) { _swift_retainCount($0) } return UInt(bitPattern: count) } -@backDeployed(before: SwiftStdlib 5.11) +@backDeployed(before: SwiftStdlib 6.0) public func _getUnownedRetainCount(_ object: AnyObject) -> UInt { let count = _withHeapObject(of: object) { _swift_unownedRetainCount($0) } return UInt(bitPattern: count) } -@backDeployed(before: SwiftStdlib 5.11) +@backDeployed(before: SwiftStdlib 6.0) public func _getWeakRetainCount(_ object: AnyObject) -> UInt { let count = _withHeapObject(of: object) { _swift_weakRetainCount($0) } return UInt(bitPattern: count) diff --git a/stdlib/public/core/DiscontiguousSlice.swift b/stdlib/public/core/DiscontiguousSlice.swift index 7e02de5720985..290b638d1ac26 100644 --- a/stdlib/public/core/DiscontiguousSlice.swift +++ b/stdlib/public/core/DiscontiguousSlice.swift @@ -12,7 +12,7 @@ /// A collection wrapper that provides access to the elements of a collection, /// indexed by a set of indices. -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) public struct DiscontiguousSlice { internal var _base: Base @@ -31,18 +31,18 @@ public struct DiscontiguousSlice { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension DiscontiguousSlice: Sendable where Base: Sendable, Base.Index: Sendable {} -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension DiscontiguousSlice: Equatable where Base.Element: Equatable { public static func ==(lhs: Self, rhs: Self) -> Bool { lhs.elementsEqual(rhs) } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension DiscontiguousSlice: Hashable where Base.Element: Hashable { public func hash(into hasher: inout Hasher) { hasher.combine(count) // delimeter; do not remove @@ -52,14 +52,14 @@ extension DiscontiguousSlice: Hashable where Base.Element: Hashable { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension DiscontiguousSlice: CustomStringConvertible { public var description: String { _makeCollectionDescription() } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension DiscontiguousSlice { /// A position in a `DiscontiguousSlice`. public struct Index { @@ -76,38 +76,38 @@ extension DiscontiguousSlice { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension DiscontiguousSlice.Index: Equatable { public static func == (left: Self, right: Self) -> Bool { left.base == right.base } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension DiscontiguousSlice.Index: Hashable where Base.Index: Hashable { public func hash(into hasher: inout Hasher) { hasher.combine(base) } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension DiscontiguousSlice.Index: Comparable { public static func < (left: Self, right: Self) -> Bool { left.base < right.base } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension DiscontiguousSlice.Index: CustomStringConvertible { public var description: String { "" } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension DiscontiguousSlice.Index: Sendable where Base.Index: Sendable {} -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension DiscontiguousSlice: Sequence { public typealias Element = Base.Element public typealias Iterator = IndexingIterator @@ -125,7 +125,7 @@ extension DiscontiguousSlice: Sequence { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension DiscontiguousSlice: Collection { public typealias SubSequence = Self public typealias Indices = DefaultIndices @@ -308,7 +308,7 @@ extension DiscontiguousSlice: Collection { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension DiscontiguousSlice: BidirectionalCollection where Base: BidirectionalCollection { @@ -331,7 +331,7 @@ extension DiscontiguousSlice: BidirectionalCollection } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension DiscontiguousSlice where Base: MutableCollection { /// Accesses the element at the specified position. /// @@ -374,7 +374,7 @@ extension Collection { /// - Returns: A collection of the elements at the positions in `subranges`. /// /// - Complexity: O(1) - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public subscript(subranges: RangeSet) -> DiscontiguousSlice { DiscontiguousSlice(_base: self, subranges: subranges) } @@ -402,7 +402,7 @@ extension Collection { /// - Returns: A collection of the elements that are not in `subranges`. /// /// - Complexity: O(*n*), where *n* is the length of the collection. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public func removingSubranges( _ subranges: RangeSet ) -> DiscontiguousSlice { diff --git a/stdlib/public/core/ErrorType.swift b/stdlib/public/core/ErrorType.swift index 3713475b67380..d48b87a2ad6ec 100644 --- a/stdlib/public/core/ErrorType.swift +++ b/stdlib/public/core/ErrorType.swift @@ -179,7 +179,7 @@ public func _bridgeErrorToNSError(_ error: __owned Error) -> AnyObject /// Called to indicate that a typed error will be thrown. @_silgen_name("swift_willThrowTypedImpl") -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) @usableFromInline func _willThrowTypedImpl(_ error: E) diff --git a/stdlib/public/core/MutableCollection.swift b/stdlib/public/core/MutableCollection.swift index 6f21400c30930..8fc77287cb114 100644 --- a/stdlib/public/core/MutableCollection.swift +++ b/stdlib/public/core/MutableCollection.swift @@ -388,7 +388,7 @@ extension MutableCollection { /// - Returns: The new bounds of the moved elements. /// /// - Complexity: O(*n* log *n*) where *n* is the length of the collection. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @discardableResult public mutating func moveSubranges( _ subranges: RangeSet, to insertionPoint: Index diff --git a/stdlib/public/core/RangeReplaceableCollection.swift b/stdlib/public/core/RangeReplaceableCollection.swift index b8bf73ced5951..60b26b9ad70d9 100644 --- a/stdlib/public/core/RangeReplaceableCollection.swift +++ b/stdlib/public/core/RangeReplaceableCollection.swift @@ -1193,7 +1193,7 @@ extension RangeReplaceableCollection { /// - Parameter subranges: The indices of the elements to remove. /// /// - Complexity: O(*n*), where *n* is the length of the collection. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public mutating func removeSubranges(_ subranges: RangeSet) { guard !subranges.isEmpty else { @@ -1224,7 +1224,7 @@ extension MutableCollection where Self: RangeReplaceableCollection { /// - Parameter subranges: The indices of the elements to remove. /// /// - Complexity: O(*n*), where *n* is the length of the collection. - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) @inlinable public mutating func removeSubranges(_ subranges: RangeSet) { guard let firstRange = subranges.ranges.first else { diff --git a/stdlib/public/core/RangeSet.swift b/stdlib/public/core/RangeSet.swift index 2eb77cd1ed762..ec29464f069fe 100644 --- a/stdlib/public/core/RangeSet.swift +++ b/stdlib/public/core/RangeSet.swift @@ -26,7 +26,7 @@ /// /// numbers.moveSubranges(negativeSubranges, to: 0) /// // numbers == [-5, -3, -9, 10, 12, 14, 15] -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) public struct RangeSet { @usableFromInline internal var _ranges: Ranges @@ -149,26 +149,26 @@ public struct RangeSet { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension RangeSet: Equatable { public static func == (left: Self, right: Self) -> Bool { left._ranges == right._ranges } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension RangeSet: Hashable where Bound: Hashable { public func hash(into hasher: inout Hasher) { hasher.combine(self._ranges) } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension RangeSet: Sendable where Bound: Sendable {} // MARK: - Collection APIs -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension RangeSet { /// Creates a new range set containing ranges that contain only the /// specified indices in the given collection. @@ -246,7 +246,7 @@ extension RangeSet { // These methods only depend on the ranges that comprise the range set, so // we can provide them even when we can't provide `SetAlgebra` conformance. -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension RangeSet { /// Adds the contents of the given range set to this range set. /// @@ -398,7 +398,7 @@ extension RangeSet { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension RangeSet: CustomStringConvertible { public var description: String { return _ranges.description diff --git a/stdlib/public/core/RangeSetRanges.swift b/stdlib/public/core/RangeSetRanges.swift index 3db430dc94597..d45cb7ca9a6a1 100644 --- a/stdlib/public/core/RangeSetRanges.swift +++ b/stdlib/public/core/RangeSetRanges.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension RangeSet { /// A collection of the ranges that make up a range set. public struct Ranges { @@ -60,7 +60,7 @@ extension RangeSet { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension RangeSet.Ranges { @usableFromInline internal func _contains(_ bound: Bound) -> Bool { @@ -267,13 +267,13 @@ extension RangeSet.Ranges { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension RangeSet.Ranges: Sequence { public typealias Element = Range public typealias Iterator = IndexingIterator } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension RangeSet.Ranges: Collection { public typealias Index = Int public typealias Indices = Range @@ -296,27 +296,27 @@ extension RangeSet.Ranges: Collection { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension RangeSet.Ranges: RandomAccessCollection {} -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension RangeSet.Ranges: Equatable { public static func == (left: Self, right: Self) -> Bool { left._storage == right._storage } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension RangeSet.Ranges: Hashable where Bound: Hashable { public func hash(into hasher: inout Hasher) { hasher.combine(_storage) } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension RangeSet.Ranges: Sendable where Bound: Sendable {} -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension RangeSet.Ranges: CustomStringConvertible { public var description: String { _makeCollectionDescription() diff --git a/stdlib/public/core/String.swift b/stdlib/public/core/String.swift index 37f71928d3e94..502c45d5ee4c8 100644 --- a/stdlib/public/core/String.swift +++ b/stdlib/public/core/String.swift @@ -518,7 +518,7 @@ extension String { /// - encoding: A conformer to `Unicode.Encoding` to be used /// to decode `codeUnits`. @inlinable - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public init?( validating codeUnits: some Sequence, as encoding: Encoding.Type @@ -580,7 +580,7 @@ extension String { /// - encoding: A conformer to `Unicode.Encoding` that can decode /// `codeUnits` as `UInt8` @inlinable - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) public init?( validating codeUnits: some Sequence, as encoding: Encoding.Type diff --git a/stdlib/public/core/StringCreate.swift b/stdlib/public/core/StringCreate.swift index 7a21c51f2b81b..591240ae01da9 100644 --- a/stdlib/public/core/StringCreate.swift +++ b/stdlib/public/core/StringCreate.swift @@ -300,7 +300,7 @@ extension String { } @usableFromInline - @available(SwiftStdlib 5.11, *) + @available(SwiftStdlib 6.0, *) internal static func _validate( _ input: UnsafeBufferPointer, as encoding: Encoding.Type diff --git a/test/Casting/CastTraps.swift.gyb b/test/Casting/CastTraps.swift.gyb index 717521801f2ea..3f7af893ef780 100644 --- a/test/Casting/CastTraps.swift.gyb +++ b/test/Casting/CastTraps.swift.gyb @@ -105,7 +105,7 @@ CastTrapsTestSuite.test("${t1}__${t2}") % end protocol P2 {} -if #available(SwiftStdlib 5.11, *) { +if #available(SwiftStdlib 6.0, *) { CastTrapsTestSuite.test("Unexpected null") .crashOutputMatches("Found a null pointer in a value of type '") .crashOutputMatches("Foo'") @@ -125,7 +125,7 @@ CastTrapsTestSuite.test("Unexpected null") #if _runtime(_ObjC) -if #available(SwiftStdlib 5.11, *) { +if #available(SwiftStdlib 6.0, *) { CastTrapsTestSuite.test("Unexpected Obj-C null") .crashOutputMatches("Found a null pointer in a value of type 'NSObject'") .crashOutputMatches("(Detected while casting to '") diff --git a/test/Concurrency/typed_throws.swift b/test/Concurrency/typed_throws.swift index 5ce519aeb9702..621d3b1f01e7c 100644 --- a/test/Concurrency/typed_throws.swift +++ b/test/Concurrency/typed_throws.swift @@ -7,14 +7,14 @@ enum MyError: Error { case epicFailed } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) func testAsyncFor(seq: S) async throws(MyError) { // expected-error@+1{{thrown expression type 'S.Failure' cannot be converted to error type 'MyError'}} for try await _ in seq { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) func testAsyncFor(seq: S) async throws(MyError) where S.Failure == MyError { diff --git a/test/Distributed/Macros/distributed_macro_expansion_DistributedProtocol_simple.swift b/test/Distributed/Macros/distributed_macro_expansion_DistributedProtocol_simple.swift index 09bdb83c6ed00..98dce265239f3 100644 --- a/test/Distributed/Macros/distributed_macro_expansion_DistributedProtocol_simple.swift +++ b/test/Distributed/Macros/distributed_macro_expansion_DistributedProtocol_simple.swift @@ -30,7 +30,7 @@ protocol Greeter: DistributedActor where ActorSystem: DistributedActorSystem String { -// CHECK: if #available (SwiftStdlib 5.11, *) { +// CHECK: if #available (SwiftStdlib 6.0, *) { // CHECK: Distributed._distributedStubFatalError() // CHECK: } else { // CHECK: fatalError() diff --git a/test/IRGen/objc.swift b/test/IRGen/objc.swift index 5472fb1bc0055..9f27cf95951ff 100644 --- a/test/IRGen/objc.swift +++ b/test/IRGen/objc.swift @@ -139,7 +139,7 @@ class WeakObjC { // CHECK: i32 1, !"Objective-C Version", i32 2} // CHECK: i32 1, !"Objective-C Image Info Version", i32 0} // CHECK: i32 1, !"Objective-C Image Info Section", !"__DATA,__objc_imageinfo,regular,no_dead_strip"} -// 84608768 == (5 << 24) | (11 << 16) | (7 << 8). +// 100665088 == (6 << 24) | (0 << 16) | (7 << 8). // 5 and 8 is the current major.minor version. 7 is the Swift ABI version. -// CHECK: i32 4, !"Objective-C Garbage Collection", i32 84608768} +// CHECK: i32 4, !"Objective-C Garbage Collection", i32 100665088} // CHECK: i32 1, !"Swift Version", i32 7} diff --git a/test/Interop/Cxx/exceptions/objc-trap-on-exception-irgen-itanium.swift b/test/Interop/Cxx/exceptions/objc-trap-on-exception-irgen-itanium.swift index 3a11c49755e52..4f490c1a2e0e8 100644 --- a/test/Interop/Cxx/exceptions/objc-trap-on-exception-irgen-itanium.swift +++ b/test/Interop/Cxx/exceptions/objc-trap-on-exception-irgen-itanium.swift @@ -1,7 +1,7 @@ // RUN: %empty-directory(%t) // RUN: split-file %s %t -// RUN: %target-swift-emit-ir -target %target-future-triple -min-runtime-version 5.11 %t/test.swift -I %t/Inputs -enable-experimental-cxx-interop | %FileCheck %s +// RUN: %target-swift-emit-ir -target %target-future-triple -min-runtime-version 6.0 %t/test.swift -I %t/Inputs -enable-experimental-cxx-interop | %FileCheck %s // RUN: %target-swift-emit-ir -target %target-triple -min-runtime-version 5.9 %t/test.swift -I %t/Inputs -enable-experimental-cxx-interop | %FileCheck %s --check-prefix=GXX // REQUIRES: objc_interop diff --git a/test/Interop/Cxx/exceptions/trap-on-exception-irgen-itanium.swift b/test/Interop/Cxx/exceptions/trap-on-exception-irgen-itanium.swift index 6ff5d7c916341..80864c3da0994 100644 --- a/test/Interop/Cxx/exceptions/trap-on-exception-irgen-itanium.swift +++ b/test/Interop/Cxx/exceptions/trap-on-exception-irgen-itanium.swift @@ -1,8 +1,8 @@ // RUN: %empty-directory(%t) // RUN: split-file %s %t -// RUN: %target-swift-emit-ir -target %target-future-triple -min-runtime-version 5.11 %t/test.swift -I %t/Inputs -enable-experimental-cxx-interop | %FileCheck %s -// RUN: %target-swift-emit-ir -target %target-future-triple -min-runtime-version 5.11 %t/test.swift -I %t/Inputs -enable-experimental-cxx-interop -g | %FileCheck --check-prefix=DEBUG %s +// RUN: %target-swift-emit-ir -target %target-future-triple -min-runtime-version 6.0 %t/test.swift -I %t/Inputs -enable-experimental-cxx-interop | %FileCheck %s +// RUN: %target-swift-emit-ir -target %target-future-triple -min-runtime-version 6.0 %t/test.swift -I %t/Inputs -enable-experimental-cxx-interop -g | %FileCheck --check-prefix=DEBUG %s // RUN: %target-swift-emit-ir -target %target-triple -min-runtime-version 5.9 %t/test.swift -I %t/Inputs -enable-experimental-cxx-interop | %FileCheck --check-prefix=GXX %s // RUN: %target-swift-emit-ir -target %target-triple -min-runtime-version 5.9 %t/test.swift -I %t/Inputs -enable-experimental-cxx-interop -g | %FileCheck --check-prefix=GXX %s diff --git a/test/Macros/macro_expand_body.swift b/test/Macros/macro_expand_body.swift index 3bcded30764aa..07e2c82092d66 100644 --- a/test/Macros/macro_expand_body.swift +++ b/test/Macros/macro_expand_body.swift @@ -78,7 +78,7 @@ func g(a: Int, b: String) async throws -> String { doesNotTypeCheck() } -#if compiler(>=5.11) && TEST_DIAGNOSTICS +#if compiler(>=6.0) && TEST_DIAGNOSTICS @available(SwiftStdlib 5.1, *) @Remote func h(a: Int, b: String) async throws -> String { diff --git a/test/ModuleInterface/verify-module-interfaces-no-lazy-typecheck.swift b/test/ModuleInterface/verify-module-interfaces-no-lazy-typecheck.swift index 4818f3b28ef7e..12dcfefeb8562 100644 --- a/test/ModuleInterface/verify-module-interfaces-no-lazy-typecheck.swift +++ b/test/ModuleInterface/verify-module-interfaces-no-lazy-typecheck.swift @@ -1,5 +1,5 @@ // swift-interface-format-version: 1.0 -// swift-compiler-version: Swift version 5.11 +// swift-compiler-version: Swift version 6.0 // swift-module-flags: -swift-version 5 -enable-library-evolution -module-name Test // expected-error @-3 {{failed to verify module interface of 'Test'}} import Swift diff --git a/test/Runtime/demangleToMetadata.swift b/test/Runtime/demangleToMetadata.swift index 4c115ad14a99d..03f32ec761a74 100644 --- a/test/Runtime/demangleToMetadata.swift +++ b/test/Runtime/demangleToMetadata.swift @@ -536,13 +536,13 @@ enum MyBigError: Error { case epicFail } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) func getFnTypeWithThrownError(_: E.Type) -> Any.Type { typealias Fn = (Int) throws(E) -> Void return Fn.self } -if #available(SwiftStdlib 5.11, *) { +if #available(SwiftStdlib 6.0, *) { DemangleToMetadataTests.test("typed throws") { typealias Fn = (Int) throws(MyBigError) -> Void expectEqual("ySi4main10MyBigErrorOYKc", _mangledTypeName(Fn.self)!) diff --git a/test/Serialization/Recovery/types-5-to-4.swift b/test/Serialization/Recovery/types-5-to-4.swift index 6dc08089f223e..16b5a8d5fa5a5 100644 --- a/test/Serialization/Recovery/types-5-to-4.swift +++ b/test/Serialization/Recovery/types-5-to-4.swift @@ -16,8 +16,8 @@ import Lib func requiresConformance(_: B_RequiresConformance) {} func requiresConformance(_: B_RequiresConformance) {} -class Sub: Base {} // expected-error {{cannot inherit from class 'Base' (compiled with Swift 5.11) because it has overridable members that could not be loaded in Swift 4.1.50}} -class Impl: Proto {} // expected-error {{type 'Impl' cannot conform to protocol 'Proto' (compiled with Swift 5.11) because it has requirements that could not be loaded in Swift 4.1.50}} +class Sub: Base {} // expected-error {{cannot inherit from class 'Base' (compiled with Swift 6.0) because it has overridable members that could not be loaded in Swift 4.1.50}} +class Impl: Proto {} // expected-error {{type 'Impl' cannot conform to protocol 'Proto' (compiled with Swift 6.0) because it has requirements that could not be loaded in Swift 4.1.50}} #else // TEST diff --git a/test/SourceKit/Misc/compiler_version.swift b/test/SourceKit/Misc/compiler_version.swift index 80dc614a13acc..f4e6390a93277 100644 --- a/test/SourceKit/Misc/compiler_version.swift +++ b/test/SourceKit/Misc/compiler_version.swift @@ -1,5 +1,5 @@ // RUN: %sourcekitd-test -req=compiler-version | %FileCheck %s -// CHECK: key.version_major: 5 -// CHECK: key.version_minor: 11 +// CHECK: key.version_major: 6 +// CHECK: key.version_minor: 0 // CHECK: key.version_patch: 0 diff --git a/test/stdlib/Atomics/AtomicLazyReference.swift b/test/stdlib/Atomics/AtomicLazyReference.swift index 91eb514edebf9..2f124e37d9542 100644 --- a/test/stdlib/Atomics/AtomicLazyReference.swift +++ b/test/stdlib/Atomics/AtomicLazyReference.swift @@ -7,7 +7,7 @@ import StdlibUnittest let suite = TestSuite("AtomicLazyReference") -if #available(SwiftStdlib 5.11, *) { +if #available(SwiftStdlib 6.0, *) { suite.test("creation") { expectEqual(LifetimeTracked.instances, 0) @@ -40,6 +40,6 @@ suite.test("storeIfNil") { expectEqual(LifetimeTracked.instances, 0) } -} // if #available(SwiftStdlib 5.11) +} // if #available(SwiftStdlib 6.0) runAllTests() diff --git a/test/stdlib/Atomics/Basics/Tests.gyb-template b/test/stdlib/Atomics/Basics/Tests.gyb-template index f445ddd6defd4..8b5925238fa37 100644 --- a/test/stdlib/Atomics/Basics/Tests.gyb-template +++ b/test/stdlib/Atomics/Basics/Tests.gyb-template @@ -78,7 +78,7 @@ let _baz1 = Baz(1) let _baz2 = Baz(2) % end -if #available(SwiftStdlib 5.11, *) { +if #available(SwiftStdlib 6.0, *) { suite.test("Atomic${label} creation") { let v = Atomic<${type}>(${a}) @@ -357,7 +357,7 @@ suite.test("Atomic${label} ${name} ${order}") { % end % end % end -} // if #available(SwiftStdlib 5.11, *) +} // if #available(SwiftStdlib 6.0, *) % end %{ # Local Variables: diff --git a/test/stdlib/Atomics/LockFreeSingleConsumerStack.swift b/test/stdlib/Atomics/LockFreeSingleConsumerStack.swift index c6f1f62006be0..f58126bbdd534 100644 --- a/test/stdlib/Atomics/LockFreeSingleConsumerStack.swift +++ b/test/stdlib/Atomics/LockFreeSingleConsumerStack.swift @@ -9,7 +9,7 @@ import Dispatch let suite = TestSuite("LockFreeSingleConsumerStackTests") -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) class LockFreeSingleConsumerStack { struct Node { let value: Element @@ -67,7 +67,7 @@ class LockFreeSingleConsumerStack { } } -if #available(SwiftStdlib 5.11, *) { +if #available(SwiftStdlib 6.0, *) { suite.test("basics") { let stack = LockFreeSingleConsumerStack() @@ -138,6 +138,6 @@ suite.test("concurrentPushesAndPops") { } } -} // if #available(SwiftStdlib 5.11) +} // if #available(SwiftStdlib 6.0) runAllTests() diff --git a/test/stdlib/Atomics/WordPair.swift b/test/stdlib/Atomics/WordPair.swift index 30fb0f4825d72..d7bdb77df9f67 100644 --- a/test/stdlib/Atomics/WordPair.swift +++ b/test/stdlib/Atomics/WordPair.swift @@ -17,7 +17,7 @@ struct UIntPair: Equatable { } } -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) func componentsInMemoryOrder(of dword: WordPair) -> UIntPair { let p = UnsafeMutableRawPointer.allocate( byteCount: MemoryLayout.size, @@ -28,7 +28,7 @@ func componentsInMemoryOrder(of dword: WordPair) -> UIntPair { return UIntPair(first, second) } -if #available(SwiftStdlib 5.11, *) { +if #available(SwiftStdlib 6.0, *) { suite.test("basics") { expectEqual(MemoryLayout.size, 2 * MemoryLayout.size) @@ -47,6 +47,6 @@ suite.test("basics") { expectEqual(value1.second, 0) } -} // if #available(SwiftStdlib 5.11, *) +} // if #available(SwiftStdlib 6.0, *) runAllTests() diff --git a/test/stdlib/Error.swift b/test/stdlib/Error.swift index 7737a19e6b834..2c4be3e370295 100644 --- a/test/stdlib/Error.swift +++ b/test/stdlib/Error.swift @@ -255,8 +255,8 @@ ErrorTests.test("willThrow") { expectEqual(2, errors.count) expectEqual(SillyError.self, type(of: errors.last!)) - // Typed errors introduced in Swift 5.11 - guard #available(SwiftStdlib 5.11, *) else { + // Typed errors introduced in Swift 6.0 + guard #available(SwiftStdlib 6.0, *) else { return } diff --git a/test/stdlib/StringCreate.swift b/test/stdlib/StringCreate.swift index e53bd8416df31..5ce444c6ca3be 100644 --- a/test/stdlib/StringCreate.swift +++ b/test/stdlib/StringCreate.swift @@ -149,11 +149,11 @@ let s2 = "Long ascii string with no accented characters (obviously)." StringCreateTests.test("Validating.utf8") .skip(.custom( - { if #available(SwiftStdlib 5.11, *) { false } else { true } }, - reason: "Requires Swift 5.11's standard library" + { if #available(SwiftStdlib 6.0, *) { false } else { true } }, + reason: "Requires Swift 6.0's standard library" )) .code { - guard #available(SwiftStdlib 5.11, *) else { return } + guard #available(SwiftStdlib 6.0, *) else { return } let i1 = Array(s1.utf8) let i2 = Array(s2.utf8) @@ -183,11 +183,11 @@ StringCreateTests.test("Validating.utf8") StringCreateTests.test("Validating.utf8.from.int8") .skip(.custom( - { if #available(SwiftStdlib 5.11, *) { false } else { true } }, - reason: "Requires Swift 5.11's standard library" + { if #available(SwiftStdlib 6.0, *) { false } else { true } }, + reason: "Requires Swift 6.0's standard library" )) .code { - guard #available(SwiftStdlib 5.11, *) else { return } + guard #available(SwiftStdlib 6.0, *) else { return } let i1 = s1.utf8.map(Int8.init(bitPattern:)) let i2 = s2.utf8.map(Int8.init(bitPattern:)) @@ -210,11 +210,11 @@ StringCreateTests.test("Validating.utf8.from.int8") StringCreateTests.test("Validating.ascii") .skip(.custom( - { if #available(SwiftStdlib 5.11, *) { false } else { true } }, - reason: "Requires Swift 5.11's standard library" + { if #available(SwiftStdlib 6.0, *) { false } else { true } }, + reason: "Requires Swift 6.0's standard library" )) .code { - guard #available(SwiftStdlib 5.11, *) else { return } + guard #available(SwiftStdlib 6.0, *) else { return } let i1 = Array(s1.utf8) let i2 = Array(s2.utf8) @@ -237,11 +237,11 @@ StringCreateTests.test("Validating.ascii") StringCreateTests.test("Validating.utf16") .skip(.custom( - { if #available(SwiftStdlib 5.11, *) { false } else { true } }, - reason: "Requires Swift 5.11's standard library" + { if #available(SwiftStdlib 6.0, *) { false } else { true } }, + reason: "Requires Swift 6.0's standard library" )) .code { - guard #available(SwiftStdlib 5.11, *) else { return } + guard #available(SwiftStdlib 6.0, *) else { return } let i1 = Array(s1.utf16) let i2 = Array(s2.utf16) @@ -264,11 +264,11 @@ StringCreateTests.test("Validating.utf16") StringCreateTests.test("Validating.utf32") .skip(.custom( - { if #available(SwiftStdlib 5.11, *) { false } else { true } }, - reason: "Requires Swift 5.11's standard library" + { if #available(SwiftStdlib 6.0, *) { false } else { true } }, + reason: "Requires Swift 6.0's standard library" )) .code { - guard #available(SwiftStdlib 5.11, *) else { return } + guard #available(SwiftStdlib 6.0, *) else { return } let i1 = s1.unicodeScalars.map(\.value) let i2 = s2.unicodeScalars.map(\.value) diff --git a/utils/availability-macros.def b/utils/availability-macros.def index 8fa3bf1e1292a..4754b750ca03d 100644 --- a/utils/availability-macros.def +++ b/utils/availability-macros.def @@ -35,9 +35,9 @@ SwiftStdlib 5.7:macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0 SwiftStdlib 5.8:macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4 SwiftStdlib 5.9:macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0 SwiftStdlib 5.10:macOS 14.4, iOS 17.4, watchOS 10.4, tvOS 17.4 -SwiftStdlib 5.11:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999 +SwiftStdlib 6.0:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999 # TODO: Also update ASTContext::getSwift510Availability when needed -# TODO: Also update ASTContext::getSwift511Availability when needed +# TODO: Also update ASTContext::getSwift60Availability when needed # Local Variables: # mode: conf-unix diff --git a/utils/build_swift/build_swift/defaults.py b/utils/build_swift/build_swift/defaults.py index dfb5f99e6b4ee..0fc8cd90873ab 100644 --- a/utils/build_swift/build_swift/defaults.py +++ b/utils/build_swift/build_swift/defaults.py @@ -46,7 +46,7 @@ CMAKE_GENERATOR = 'Ninja' COMPILER_VENDOR = 'none' -SWIFT_USER_VISIBLE_VERSION = Version('5.11') +SWIFT_USER_VISIBLE_VERSION = Version('6.0') CLANG_USER_VISIBLE_VERSION = Version('17.0.0') SWIFT_ANALYZE_CODE_COVERAGE = 'false' diff --git a/validation-test/stdlib/RangeSet.swift b/validation-test/stdlib/RangeSet.swift index ae6329d5612b4..9f7abb988bc9c 100644 --- a/validation-test/stdlib/RangeSet.swift +++ b/validation-test/stdlib/RangeSet.swift @@ -4,7 +4,7 @@ import StdlibUnittest import StdlibCollectionUnittest -@available(SwiftStdlib 5.11, *) +@available(SwiftStdlib 6.0, *) extension RangeSet: ExpressibleByArrayLiteral { public init(arrayLiteral elements: Range...) { self.init(elements) @@ -21,7 +21,7 @@ extension Collection { let RangeSetTests = TestSuite("RangeSet") -if #available(SwiftStdlib 5.11, *) { +if #available(SwiftStdlib 6.0, *) { let parent = -200..<200 let source: RangeSet = [1..<5, 8..<10, 20..<22, 27..<29] From a3c3d3e2efc2b706c3fef317b8219866f5ffea82 Mon Sep 17 00:00:00 2001 From: Evan Wilde Date: Mon, 19 Feb 2024 18:47:58 -0800 Subject: [PATCH 2/7] Set version info with `#define` Don't use `#cmakedefine` to define values that can be zero. `#cmakedefine` only sets the definition when the corresponding value in CMake itself has a truthy value. `0` has a false-y value, so SWIFT_VERSION_MINOR is undefined for 6.0 resulting in some things breaking. --- include/swift/Runtime/CMakeConfig.h.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/swift/Runtime/CMakeConfig.h.in b/include/swift/Runtime/CMakeConfig.h.in index 4f31705582890..14d141525659c 100644 --- a/include/swift/Runtime/CMakeConfig.h.in +++ b/include/swift/Runtime/CMakeConfig.h.in @@ -7,7 +7,7 @@ #cmakedefine01 SWIFT_BNI_OS_BUILD #cmakedefine01 SWIFT_BNI_XCODE_BUILD -#cmakedefine SWIFT_VERSION_MAJOR "@SWIFT_VERSION_MAJOR@" -#cmakedefine SWIFT_VERSION_MINOR "@SWIFT_VERSION_MINOR@" +#define SWIFT_VERSION_MAJOR "@SWIFT_VERSION_MAJOR@" +#define SWIFT_VERSION_MINOR "@SWIFT_VERSION_MINOR@" #endif From 2173c52e0239572a49a9a6cda59e4de9ac94b8cc Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Mon, 19 Feb 2024 19:20:19 -0800 Subject: [PATCH 3/7] Set the default compiler effective language version to Swift 5 for now --- include/swift/Basic/LangOptions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/swift/Basic/LangOptions.h b/include/swift/Basic/LangOptions.h index 86dc8fb07c897..ec3d2f2208bf3 100644 --- a/include/swift/Basic/LangOptions.h +++ b/include/swift/Basic/LangOptions.h @@ -172,7 +172,7 @@ namespace swift { /// /// User-overridable language version to compile for. - version::Version EffectiveLanguageVersion = version::Version::getCurrentLanguageVersion(); + version::Version EffectiveLanguageVersion = version::Version{5}; /// Swift runtime version to compile for. version::Version RuntimeVersion = version::Version::getCurrentLanguageVersion(); From a19021d8da46a83e2f38ba50945e8c9fc6ff19ce Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Tue, 20 Feb 2024 14:30:12 -0800 Subject: [PATCH 4/7] Fix the Serialization/version-mismatches.swift Swift version --- test/Serialization/version-mismatches.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Serialization/version-mismatches.swift b/test/Serialization/version-mismatches.swift index ee15783a48a85..26db4d9c0b302 100644 --- a/test/Serialization/version-mismatches.swift +++ b/test/Serialization/version-mismatches.swift @@ -12,7 +12,7 @@ import Library // TOO-NEW: :[[@LINE-2]]:8: error: compiled module was created by a newer version of the compiler: {{.*}}too-new/Library.swiftmodule{{$}} // Update this line when the compiler version changes. -// LANGUAGE: :[[@LINE-5]]:8: error: module compiled with Swift X.Y cannot be imported by the Swift 5.{{.+}} compiler: {{.*}}too-{{old|new}}-language/Library.swiftmodule{{$}} +// LANGUAGE: :[[@LINE-5]]:8: error: module compiled with Swift X.Y cannot be imported by the Swift 6.{{.+}} compiler: {{.*}}too-{{old|new}}-language/Library.swiftmodule{{$}} // Compiler thinks that the module is empty in all cases. // CHECK: :[[@LINE+1]]:1: error: module 'Library' has no member named 'foo' From 9a1d86c5bb1147f89effec6eee54bae4747df8f8 Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Wed, 21 Feb 2024 12:37:23 -0800 Subject: [PATCH 5/7] Set the minor version to 10 (5.10) for language version --- include/swift/Basic/LangOptions.h | 2 +- lib/Basic/Version.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/swift/Basic/LangOptions.h b/include/swift/Basic/LangOptions.h index 603d417d43510..2d55845004b00 100644 --- a/include/swift/Basic/LangOptions.h +++ b/include/swift/Basic/LangOptions.h @@ -172,7 +172,7 @@ namespace swift { /// /// User-overridable language version to compile for. - version::Version EffectiveLanguageVersion = version::Version{5}; + version::Version EffectiveLanguageVersion = version::Version{5, 10}; /// Swift runtime version to compile for. version::Version RuntimeVersion = version::Version::getCurrentLanguageVersion(); diff --git a/lib/Basic/Version.cpp b/lib/Basic/Version.cpp index 773fb4affa94d..8a711afe87b69 100644 --- a/lib/Basic/Version.cpp +++ b/lib/Basic/Version.cpp @@ -176,7 +176,7 @@ llvm::Optional Version::getEffectiveLanguageVersion() const { assert(size() == 2 && Components[0] == 4 && Components[1] == 2); return Version{4, 2}; case 5: - return Version{5}; + return Version{5, 10}; case 6: static_assert(SWIFT_VERSION_MAJOR == 6, "getCurrentLanguageVersion is no longer correct here"); From 6c306e3d435ff5667f70f37ba9bb5218f3cff276 Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Wed, 21 Feb 2024 14:39:27 -0800 Subject: [PATCH 6/7] Update the SwiftStdlib version to 6.0 and fix Frontend/crash.swift test --- ...uted_macro_expansion_DistributedProtocol_inheritance.swift | 4 ++-- test/Frontend/crash.swift | 2 +- test/Runtime/demangleToMetadataTransferring.swift | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/Distributed/Macros/distributed_macro_expansion_DistributedProtocol_inheritance.swift b/test/Distributed/Macros/distributed_macro_expansion_DistributedProtocol_inheritance.swift index c02934d29d49a..c7f8d24b84d8c 100644 --- a/test/Distributed/Macros/distributed_macro_expansion_DistributedProtocol_inheritance.swift +++ b/test/Distributed/Macros/distributed_macro_expansion_DistributedProtocol_inheritance.swift @@ -46,14 +46,14 @@ protocol G3: DistributedActor, EmptyBase where ActorSystem: Distrib // CHECK: extension G3 where Self: Distributed._DistributedActorStub { // CHECK: func get() -> String { -// CHECK: if #available (SwiftStdlib 5.11, *) { +// CHECK: if #available (SwiftStdlib 6.0, *) { // CHECK: Distributed._distributedStubFatalError() // CHECK: } else { // CHECK: fatalError() // CHECK: } // CHECK: } // CHECK: distributed func greet(name: String) -> String { -// CHECK: if #available (SwiftStdlib 5.11, *) { +// CHECK: if #available (SwiftStdlib 6.0, *) { // CHECK: Distributed._distributedStubFatalError() // CHECK: } else { // CHECK: fatalError() diff --git a/test/Frontend/crash.swift b/test/Frontend/crash.swift index de27fb87582c1..476dff6089332 100644 --- a/test/Frontend/crash.swift +++ b/test/Frontend/crash.swift @@ -18,7 +18,7 @@ // RUN: not --crash %target-swift-frontend -typecheck -debug-crash-after-parse -experimental-allow-module-with-compiler-errors -swift-version 5 %s 2>&1 | %FileCheck -check-prefix CHECK-CURRENT %s // CHECK-CURRENT: Program arguments: {{.*}} -experimental-allow-module-with-compiler-errors -// CHECK-CURRENT: Compiling with the current language version while allowing modules with compiler errors +// CHECK-CURRENT: Compiling with effective version {{.*}} while allowing modules with compiler errors func anchor() {} anchor() diff --git a/test/Runtime/demangleToMetadataTransferring.swift b/test/Runtime/demangleToMetadataTransferring.swift index 04b75def48205..77d9b5ed822ed 100644 --- a/test/Runtime/demangleToMetadataTransferring.swift +++ b/test/Runtime/demangleToMetadataTransferring.swift @@ -21,7 +21,7 @@ class Klass {} let DemangleToMetadataTests = TestSuite("DemangleToMetadata") -if #available(SwiftStdlib 5.11, *) { +if #available(SwiftStdlib 6.0, *) { DemangleToMetadataTests.test("transferring parameter") { typealias Fn = (transferring Klass) -> Void expectEqual("y4main5KlassCnYuc", _mangledTypeName(Fn.self)!) From cc6996385c26754a20bffd56f66777dc8ce97927 Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Wed, 21 Feb 2024 15:20:03 -0800 Subject: [PATCH 7/7] Fix the test/Serialization/Recovery/types-5-to-4.swift test string to match Swift version 5.10 --- test/Serialization/Recovery/types-5-to-4.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Serialization/Recovery/types-5-to-4.swift b/test/Serialization/Recovery/types-5-to-4.swift index 16b5a8d5fa5a5..79a117c371e15 100644 --- a/test/Serialization/Recovery/types-5-to-4.swift +++ b/test/Serialization/Recovery/types-5-to-4.swift @@ -16,8 +16,8 @@ import Lib func requiresConformance(_: B_RequiresConformance) {} func requiresConformance(_: B_RequiresConformance) {} -class Sub: Base {} // expected-error {{cannot inherit from class 'Base' (compiled with Swift 6.0) because it has overridable members that could not be loaded in Swift 4.1.50}} -class Impl: Proto {} // expected-error {{type 'Impl' cannot conform to protocol 'Proto' (compiled with Swift 6.0) because it has requirements that could not be loaded in Swift 4.1.50}} +class Sub: Base {} // expected-error {{cannot inherit from class 'Base' (compiled with Swift 5.10) because it has overridable members that could not be loaded in Swift 4.1.50}} +class Impl: Proto {} // expected-error {{type 'Impl' cannot conform to protocol 'Proto' (compiled with Swift 5.10) because it has requirements that could not be loaded in Swift 4.1.50}} #else // TEST