-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[6.0][stdlib] Start adopting noncopyable generics in the stdlib #72436
Merged
lorentey
merged 55 commits into
swiftlang:release/6.0
from
lorentey:noncopyable-primitives-6.0
Mar 20, 2024
Merged
[6.0][stdlib] Start adopting noncopyable generics in the stdlib #72436
lorentey
merged 55 commits into
swiftlang:release/6.0
from
lorentey:noncopyable-primitives-6.0
Mar 20, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[stdlib] MemoryLayout: Update Swift version numbers [stdlib] MemoryLayout: Actually hide legacy ABI
… types [stdlib] Pull back @_aeic on pointer → integer conversions [stdlib] UnsafeMutablePointer.allocate: Fix thinko [stdlib] Disable support for noncopyable pointees on some pointer operations We have to temporarily pull back support for noncopyable pointees for UnsafeMutablePointer.initialize(to:), .moveInitialize, .moveUpdate, as the builtins they’re calling are no longer accepting such types. These will return following a builtin audit. [stdlib] Remove workarounds for certain builtins not supporting noncopyable use swiftlang#71733 fixed this! [stdlib] Update FIXME [stdlib] UnsafePointer: Update Swift version numbers [stdlib] UnsafePointer: Actually hide legacy ABI [stdlib] Remove workaround for U[M]BP.withMemoryRebound
- Enable BorrowingSwitch feature within the stdlib - ExpressibleByNilLiteral: Add retroactive support for noncopyable conforming types - Optional: draft an API surface for noncopyable payloads [stdlib] Oops, the ExpressibleByNilLiteral conformance kept its implicit copyability
…P.isEmpty These `isEmpty` descriptors got upgraded from Collection extensions to direct implementations, and they now come with property descriptors (despite being `@_alwaysEmitIntoClient`).
…on facility Generalizing the result type is not yet possible, but T works!
Header is tricky, but it’s on the TODO list for later.
The missing symbols aren’t load bearing, so this should be fine as a temporary workaround.
…oolchain builds from succeeding
It’s a caseless enum, but there’s no reason to change this aspect of it.
…events toolchain builds from succeeding" This reverts commit 0266c6d.
This reverts commit 13e7aff.
[gardening] update copyright notice [gardening] update copyright notice [gardening] update copyright notice [gardening] update copyright notice
…rk when using Optional and other stdlib features
…s a suppressible feature
@swift-ci test |
@swift-ci build toolchain macOS platform |
airspeedswift
approved these changes
Mar 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a cherry-pick of #71688.
Relax the copyability requirement on the type parameters of several crucial stdlib generic types and functions:
struct MemoryLayout<T: ~Copyable>
struct UnsafePointer<Pointee: ~Copyable>
struct UnsafeMutablePointer<Pointee: ~Copyable>
struct UnsafeBufferPointer<Element: ~Copyable>
struct UnsafeMutableBufferPointer<Element: ~Copyable>
enum Optional<Wrapped: ~Copyable>: ~Copyable
enum Result<Success: ~Copyable, Failure>: ~Copyable
func swap<T: ~Copyable>
func withExtendedLifetime<T: ~Copyable, R: ~Copyable>
func withUnsafeTemporaryAllocation<T: ~Copyable, R>
(generalizingR
is a to do item for later)class ManagedBuffer<Header, Element: ~Copyable>
(generalizingHeader
is a to do for later)struct ManagedBufferPointer<Header, Element: ~Copyable>
(ditto)Except for
Optional
andResult
, making the parameter non-copyable will not affect the copyability of the type itself.