Commit Graph

7802 Commits

Author SHA1 Message Date
Karoy Lorentey
d7c402f2f2 [stdlib] Add partial ~Copyable support to withUnsafeTemporaryAllocation facility
Generalizing the result type is not yet possible, but T works!
2024-03-18 11:03:49 -07:00
Karoy Lorentey
b83282b689 [stdlib] Temporarily disable round trip validation for debug types 2024-03-18 11:03:49 -07:00
Karoy Lorentey
3507a0cf8c [stdlib] Add support for noncopyables to withUnsafePointer(to:) family 2024-03-18 11:03:49 -07:00
Karoy Lorentey
285c3d3744 [stdlib] Add support for noncopyables to withExtendedLifetime(of:) family 2024-03-18 11:03:49 -07:00
Karoy Lorentey
72fa98c4b6 [stdlib] Result: Initial support for noncopyable payloads 2024-03-18 11:03:49 -07:00
Karoy Lorentey
3cb9b3383e [stdlib] Add support for noncopyables to swap(_:_:) 2024-03-18 11:03:49 -07:00
Karoy Lorentey
5ae757181e [stdlib] UnsafeRawBufferPointer: new interactions with noncopyable types 2024-03-18 11:03:49 -07:00
Karoy Lorentey
d15d5004c8 [stdlib] Unsafe[Mutable]BufferPointer: Add support for non-copyable Pointee types 2024-03-18 11:03:49 -07:00
Karoy Lorentey
78270e1e4e [stdlib] UnsafePointer: Resolve most of the symbol mismatches 2024-03-18 11:03:49 -07:00
Karoy Lorentey
5ceb055e29 [stdlib] UnsafePointer: Don’t let the compiler synthesize hashValue 2024-03-18 11:03:49 -07:00
Karoy Lorentey
5d90d81dac [stdlib] Optional: Add @_preInverseGenerics to ExpressibleByNilLiteral conformance 2024-03-18 11:03:49 -07:00
Karoy Lorentey
deda7d6865 [stdlib] UnsafePointer: Add @_preInverseGenerics to _Pointer conformance 2024-03-18 11:03:49 -07:00
Karoy Lorentey
209c66cf74 [stdlib] UnsafePointer: Add @_preInverseGenerics to stored properties 2024-03-18 11:03:49 -07:00
Karoy Lorentey
0a676db16f [stdlib] Generalize swap(_:_:) for noncopyable types 2024-03-18 11:03:49 -07:00
Karoy Lorentey
805f94b5a8 [stdlib] OpaquePointer: Adopt @_preInverseGenerics 2024-03-18 11:03:49 -07:00
Karoy Lorentey
d6296ab966 [stdlib] UnsafeRawPointer: Adopt @_preInverseGenerics 2024-03-18 11:03:49 -07:00
Karoy Lorentey
baa317c29a [stdlib] Optional: Adopt @_preInverseGenerics 2024-03-18 11:03:49 -07:00
Karoy Lorentey
56ddafb0a0 [stdlib] UnsafePointer: Adopt @_preInverseGenerics 2024-03-18 11:03:49 -07:00
Karoy Lorentey
bfd2b068c1 [stdlib] MemoryLayout: Adopt @_preInverseGenerics 2024-03-18 11:03:49 -07:00
Karoy Lorentey
7d87ad5a8a [stdlib] OpaquePointer: new interactions with noncopyable types 2024-03-18 11:03:49 -07:00
Karoy Lorentey
0568dbf903 [stdlib] UnsafeRawPointer: new interactions with noncopyable types 2024-03-18 11:03:49 -07:00
Karoy Lorentey
85a6b97e7a [stdlib] Optional: Initial support for noncopyable payloads
- 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
2024-03-18 11:03:49 -07:00
Karoy Lorentey
d0b39ac8db [stdlib] Unsafe[Mutable]Pointer: Add support for non-copyable Pointee 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

https://github.com/apple/swift/pull/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
2024-03-18 11:03:49 -07:00
Karoy Lorentey
7fc54cab80 [stdlib] MemoryLayout: Add support for non-copyable type arguments
[stdlib] MemoryLayout: Update Swift version numbers

[stdlib] MemoryLayout: Actually hide legacy ABI
2024-03-18 11:03:48 -07:00
Guillaume Lessard
d00866aa3c Merge pull request #72365 from glessard/rethrowing-disappearing-act
[stdlib] preserve untyped-throws versions of functions
2024-03-15 19:36:19 -07:00
Guillaume Lessard
8459d0616d [stdlib] make swiftinterfaces compatible with older toolchains 2024-03-15 16:50:12 -07:00
David Smith
dc405525f9 Optimize checking for all-ASCII bytes (#72312) 2024-03-14 16:13:34 -07:00
Kuba (Brecka) Mracek
d5e5723294 Merge pull request #72293 from kubamracek/embedded-synchronization
[embedded] Start building Synchronization in embedded Swift mode
2024-03-13 18:46:28 -07:00
Allan Shortlidge
20a8399488 stdlib: Guard @inlinable use of withMemoryRebound() with #if $TypedThrows.
Older compilers can no longer see the definition of `withMemoryRebound()` now
that it has adopted typed throws (https://github.com/apple/swift/pull/72036).

Resolves rdar://124540428
2024-03-13 11:38:24 -07:00
Kuba Mracek
48b8228acd [embedded] Start building Synchronization in embedded Swift mode 2024-03-13 10:07:37 -07:00
Alejandro Alonso
56bb298d14 Merge pull request #72258 from Azoy/commandline-fixes
[stdlib] Deprecate CommandLine.arguments setter
2024-03-12 16:45:26 -07:00
Guillaume Lessard
d4abcde64a Merge pull request #72233 from glessard/toplevel-withUUMP-typed-throws
[stdlib] convert `_withUnprotectedUnsafeMutablePointer()` to typed throws
2024-03-12 14:39:46 -07:00
Alejandro Alonso
552edd2ccb Merge pull request #72101 from Azoy/sendable-all-the-things
[stdlib] Sendablize all the things
2024-03-12 13:37:15 -07:00
Alejandro Alonso
9d318220b9 Deprecate CommandLine.arguments setter 2024-03-12 09:54:53 -07:00
Alejandro Alonso
17401c627b Remove explicit unavailable sendable from keypath 2024-03-12 09:20:40 -07:00
Doug Gregor
5bdd4e5772 Improve @_implements for associated type witnesses
Allow `@_implements` to be expressed in an extension of the protocol in
which the associated type is defined. Use this to uncomment an
intended use of `@_implements` in `Sequence` that could be used to
replace a longstanding hack for associated type inference.

Since this change means that the standard library module interface
won't be accepted by older compilers, introduce a suppressible feature
ssociatedTypeImplements` that covers the use of `@_implements` on type
declarations. This will hide the `@_implements` attribute from older
compilers.
2024-03-11 14:28:20 -07:00
Guillaume Lessard
0ccfa42957 [stdlib] convert _withUnprotectedUnsafeMutablePointer() to typed throws 2024-03-11 11:34:01 -07:00
Guillaume Lessard
78273b2390 Merge pull request #72089 from glessard/toplevel-withUMP-typed-throws
[stdlib] convert `withUnsafeMutablePointer()` to typed throws
2024-03-08 13:52:23 -08:00
Guillaume Lessard
805dd70cfe Merge pull request #72074 from glessard/toplevel-withbytes-typed-throws
[stdlib] convert `withUnsafeBytes()` to typed throws
2024-03-08 08:55:08 -08:00
Oscar Byström Ericsson
af0c9fae8e FlattenSequence/distance(from:to:) untrapping Int.min (v6).
1. Put the first region inside the if-else (same branch condition).
2. Use the forward distance in the highest region (as done in the middle).
2024-03-07 13:19:45 +01:00
Meghana Gupta
806921c0c8 Allow ~Escapable types to be _BitwiseCopyable 2024-03-06 21:57:03 -08:00
Guillaume Lessard
578a058797 Merge pull request #72052 from glessard/toplevel-withpointer-typed-throws
[stdlib] convert `withUnsafePointer()` to typed throws
2024-03-06 15:01:45 -08:00
Nate Chandler
73231b185b [BitwiseCopyable] Don't apply to FixedWidthInteger.
Per LWG feedback.

This reverts commit c8119e3c01.
2024-03-06 08:12:54 -08:00
Alejandro Alonso
f9f640b141 Sendablize the standard library
oops dont add this flag

no more nonisolated
2024-03-05 15:02:09 -08:00
nate-chandler
ddacabf863 Merge pull request #72083 from nate-chandler/bitwise-copyable/20240304/1
[BitwiseCopyable] Suppress a few conformances.
2024-03-05 13:04:28 -08:00
Guillaume Lessard
82ae264b69 [stdlib] convert withUnsafeMutablePointer() to typed throws 2024-03-05 02:48:41 -08:00
Guillaume Lessard
d3cd4985d1 [stdlib] convert withUnsafePointer() to typed throws 2024-03-05 02:31:23 -08:00
Guillaume Lessard
207ae32107 [stdlib] add _withUnprotectedUnsafeMutableBytes() 2024-03-05 02:25:52 -08:00
Guillaume Lessard
528dd0967f [stdlib] convert withUnsafeMutableBytes() to typed throws 2024-03-05 02:12:04 -08:00
Guillaume Lessard
68088bc4e1 [stdlib] convert inout-taking withUnsafeBytes() to typed throws 2024-03-05 02:10:38 -08:00