Commit Graph

7762 Commits

Author SHA1 Message Date
Karoy Lorentey
463f35531c [stdlib] ObjectIdentifier: Work around issue with generalized existentials 2025-03-24 12:15:49 -07:00
Karoy Lorentey
4db7b7c69d [stdlib] Note some syntactic wrinkles 2025-03-24 12:15:47 -07:00
Karoy Lorentey
a52c060924 [stdlib] dependsOn → @lifetime 2025-03-24 12:15:46 -07:00
Karoy Lorentey
b9d7206028 [stdlib] Start generalizing Result
- Allow nonescapable `Success` types
- Generalize `Sendable` conformance
- Generalize `Result.mapError`
- Generalize `Result.get()`

Do not generalize `Result.init(catching:)` or higher-order functions involving the success value: they cannot possibly work correctly yet.
2025-03-24 12:15:44 -07:00
Karoy Lorentey
0d926834c8 [stdlib] ObjectIdentifier: Also allow nonescapable types 2025-03-24 12:15:44 -07:00
Karoy Lorentey
a0751a4a89 [stdlib] ObjectIdentifier: Allow initialization from metatypes of noncopyable types 2025-03-24 12:15:43 -07:00
Karoy Lorentey
fb3455eccf [stdlib] Generalize withExtendedLifetime; add extendLifetime 2025-03-24 12:15:42 -07:00
Karoy Lorentey
201430522b [stdlib] Generalize ManagedBufferPointer.== 2025-03-24 12:15:41 -07:00
Karoy Lorentey
351adc7d4a [stdlib] Enable NonescapableTypes 2025-03-24 12:15:41 -07:00
Karoy Lorentey
696bbac938 [stdlib] unsafeBitCast: generalize for ~Escapable input types 2025-03-24 12:15:39 -07:00
Karoy Lorentey
9b322e3e8e [stdlib] Optional: Allow non-escapable wrapped types 2025-03-24 12:15:38 -07:00
Karoy Lorentey
9d86a45af9 [stdlib] ExpressibleByNilLiteral: allow ~Escapable conformers 2025-03-24 12:15:37 -07:00
Karoy Lorentey
db92d2b915 [stdlib] Generalize MemoryLayout for ~Escapable types 2025-03-24 12:15:33 -07:00
Guillaume Lessard
c21de062bb Merge pull request #78561 from glessard/rdar137710901-span-properties-prototype
[SE-0456] Span properties (part 1)
2025-03-24 08:47:47 -07:00
Guillaume Lessard
7b035936e4 [temporary] disable spans over inline elements 2025-03-21 17:26:29 -07:00
Guillaume Lessard
d5cb7ddf64 [stdlib] changes to lifetime annotations
Changes to lifetime annotations implemented in https://github.com/swiftlang/swift/pull/80064
2025-03-21 17:24:45 -07:00
Andrew Trick
c6116be7b5 Update stdlib source with explicit @lifetime(copy self) 2025-03-19 11:59:04 -07:00
Andrew Trick
411a65be2e Add @lifetime annotation to RawSpan.init() and Span.init()
These empty initializers have @lifetime(immortal).
2025-03-19 11:59:04 -07:00
Alejandro Alonso
25b10ebf76 Merge pull request #78092 from Azoy/enumerated-collection
[stdlib] Conditionally conform EnumeratedSequence to Collection(s)
2025-03-18 09:24:08 -07:00
Ben Rimmington
bbe26880a5 [stdlib] Update InlineArray (2) (#79866)
* Amend doc comments.
* Add `guard` for empty array.
* Add tests for initialization errors.
* Use `Self.` to call static method.
* Use `_checkIndex` in `swapAt` method.
* Wrap overlong lines.
2025-03-18 05:59:15 +00:00
Doug Gregor
9c2c4ea07f Merge pull request #79707 from DougGregor/transparent-integer-conversions
[Stdlib performance] Make integer conversion operations transparent
2025-03-17 16:37:16 -07:00
Erik Eckstein
5030c829ea stdlib: annotate the compiler intrinsic function _arrayConditionalCast with a semantic attribute
This is need for the optimizer to remove redundant array casts
2025-03-15 08:32:57 +01:00
Mike Ash
f1070f7f1e Merge pull request #80000 from swiftlang/jgrynspan/145945680-mangledtypename-nonescapable
[Runtime] Allow ~Escapable types in _getMangledTypeName.
2025-03-14 11:53:12 -04:00
Guillaume Lessard
39ca3dee4d Merge pull request #80003 from glessard/span-gardening
[stdlib] fix `Span`'s `Sendable` conformance
2025-03-13 18:54:42 -07:00
Guillaume Lessard
e81a2ee3a1 [stdlib] correctly express Span sendability 2025-03-13 13:54:18 -07:00
Alejandro Alonso
b0d98549cb Update to match api acceptance 2025-03-13 09:58:44 -07:00
Alejandro Alonso
9894440454 Conditionally conform EnumeratedSequence to Collections 2025-03-13 09:58:09 -07:00
Guillaume Lessard
35b851453d [gardening] update some copyright years 2025-03-12 09:56:41 -07:00
Doug Gregor
ad626f9c0e [Stdlib performance] Make integer conversion operations transparent
The integer conversion operations were inlinable, but aren't getting
inlined in debug builds, which results in unreasonably poor
performance. Mark them as transparent so we don't end up with
unspecialized generic code in the hot path.

Fixes https://github.com/swiftlang/swift/issues/78501
2025-03-12 07:40:49 -07:00
Mike Ash
c7922b29af Merge pull request #79774 from mikeash/bigger-empty-va-list-storage
[Stdlib] Make alignedStorageForEmptyVaLists bigger.
2025-03-11 23:10:24 -04:00
Mike Ash
70e1931caa [Stdlib] Make alignedStorageForEmptyVaLists bigger.
Expand alignedStorageForEmptyVaLists to eight Doubles. This produces more predictable output for code that calls a variadic function without parameters where the function still expects them, such as passing an arbitary string to a string formatting function. It's still unsound, but this makes it more predictable.

rdar://145083971
2025-03-11 09:29:07 -04:00
Doug Gregor
733dd86c92 Merge pull request #79896 from DougGregor/strict-memory-safety-cleanups
Strict memory safety cleanups
2025-03-11 01:26:30 -07:00
Michael Gottesman
04bb69f426 Merge pull request #79727 from gottesmm/pr-025c1133954b74e7b4eda77e1a6f3bcafd4eb6cf
[concurrency] Add initial support for SwiftSettings to control defaultIsolation at the file level.
2025-03-10 22:35:00 -07:00
Michael Gottesman
f64dd5a8d5 [concurrency] Add initial support for SwiftSettings to control defaultIsolation at the file level.
We introduce a new macro called #SwiftSettings that can be used in conjunction
with a new stdlib type called SwiftSetting to control the default isolation at
the file level. It overrides the current default isolation whether it is the
current nonisolated state or main actor (when -enable-experimental-feature
UnspecifiedMeansMainActorIsolated is set).
2025-03-10 17:33:45 -07:00
Doug Gregor
f668feaf64 [Standard library] Additional strict-memory-safety annotations 2025-03-10 15:42:05 -07:00
Guillaume Lessard
940628a23a [stdlib] add newly-required unsafe annotations 2025-03-10 15:20:51 -07:00
Guillaume Lessard
39b4303e79 [stdlib] match KeyValuePairs’s Element type 2025-03-10 08:54:07 -07:00
Guillaume Lessard
83dc08d006 [stdlib] remove an unneeded annotation 2025-03-10 08:54:07 -07:00
Guillaume Lessard
7188d0b187 [stdlib] add span property to KeyValuePairs 2025-03-10 08:54:07 -07:00
Guillaume Lessard
d0d528521a [stdlib] add span property to InlineArray 2025-03-10 08:54:06 -07:00
Guillaume Lessard
264747ac77 [stdlib] add span property to CollectionOfOne 2025-03-10 08:51:56 -07:00
Guillaume Lessard
7bbb8348e3 [stdlib] add span properties to array types 2025-03-10 08:51:56 -07:00
Guillaume Lessard
acdfb3711a [stdlib] refactor lazy-eager-bridging for reusability 2025-03-10 08:51:56 -07:00
Guillaume Lessard
9cdd83b469 [stdlib] add span properties to UnsafeBufferPointer family 2025-03-10 08:51:56 -07:00
Guillaume Lessard
85b53bb023 [stdlib] add bytes property to Span 2025-03-10 08:51:56 -07:00
Guillaume Lessard
7214717fba Merge pull request #79708 from glessard/span-gardening
[SE-0447] Span and RawSpan tests
2025-03-07 22:00:58 -08:00
nate-chandler
c0ba520fac Merge pull request #79781 from nate-chandler/general-coro/20250227/1
[CoroutineAccessors] Dispatch and PtrAuth.
2025-03-07 20:08:42 -08:00
Ben Rimmington
e5487d86f0 Merge pull request #79800 from benrimmington/inline-array
[stdlib] Update `InlineArray`
2025-03-08 02:32:44 +00:00
Guillaume Lessard
4ec8c6e345 [stdlib] document unsafe behaviour for empty spans 2025-03-07 13:23:25 -08:00
Guillaume Lessard
3bd04acadb Apply suggestions from code review 2025-03-07 13:23:25 -08:00