Commit Graph

90 Commits

Author SHA1 Message Date
Guillaume Lessard
848c644638 [test] adjust api-digester data 2025-06-09 14:19:38 -07:00
Guillaume Lessard
3a0f890ef0 Merge pull request #80742 from glessard/rdar137710901-addressable-utf8view-span
[6.2, SE-0456] enable span properties for the small-String representation
2025-06-09 14:11:58 -07:00
Anthony Latsis
cdae255f9f AST: Quote attributes more consistently in DiagnosticsModuleDiffer.def 2025-04-23 19:18:11 +01:00
Guillaume Lessard
6da151ecc9 [test] amend api digester exceptions 2025-04-18 10:45:00 -07:00
Karoy Lorentey
86f6c29e34 [stdlib] Temporarily reinstate original ObjectIdentifier.init as public
The new generalization sometimes causes a runtime hang that I’m still analyzing. The original declaration should be considered more specific for preexisting use cases, eliminating the source compatibility issue.
2025-03-27 11:24:31 -07:00
Karoy Lorentey
192b404947 [stdlib] Work around ~Escapable breaking Optional.init syntax 2025-03-24 12:16:19 -07:00
Karoy Lorentey
21169d12e8 Reinstate generalization of Optional.unsafelyUnwrapped 2025-03-24 12:16:16 -07:00
Karoy Lorentey
e26ddca149 [test] Update list of false positives in source stability test 2025-03-24 12:16:14 -07:00
Karoy Lorentey
7cd98c31d4 [test] Update stability expectations 2025-03-24 12:16:04 -07:00
Karoy Lorentey
e38c9d13a6 [test] Adjust more test expectations 2025-03-24 12:15:54 -07:00
Karoy Lorentey
b41d6aa63a [test] Ritually confess these changes 2025-03-24 12:15:53 -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
Alejandro Alonso
213dcbbb53 Update stability-stdlib-abi-without-asserts.test 2025-03-13 14:21:12 -07:00
Guillaume Lessard
063b0581e3 [test] ritual acts of contrition 2025-03-10 08:54:07 -07:00
Doug Gregor
e24598bca1 Use a marker protocol SendableMetatype to model T.Type: Sendable
Introduce a marker protocol SendableMetatype that is used to indicate
when the metatype of a type will conform to Sendable. Specifically,
`T: SendableMetatype` implies `T.Type: Sendable`. When strict
metatype sendability is enabled, metatypes are only sendable when `T:
SendableMetatype`.

All nominal types implicitly conform to `SendableMetatype`, as do the
various builtin types, function types, etc. The `Sendable` marker
protocol now inherits from `SendableMetatype`, so that `T: Sendable`
implies `T.Type: Sendable`.

Thank you Slava for the excellent idea!
2025-02-13 22:48:05 -08:00
Gabor Horvath
8c03a31d65 [cxx-interop] Support transforming lifetimebound spans
This PR adds basic support for storing lifetime dependence information,
transform Span return types, and generate lifetime annotations.

rdar://139074571
2025-01-21 10:51:04 +00:00
Henrik G. Olsson
d7bd76e9f1 [Swiftify] Add return pointer support (#78571)
* Import __counted_by for function return values

Instead of simply passing a parameter index to _SwiftifyInfo, the
_SwiftifyExpr enum is introduced. It currently has two cases:
 - .param(index: Int), corresponding to the previous parameter index
 - .return, corresponding to the function's return value.

ClangImporter is also updated to pass this new information along to
_SwiftifyImport, allowing overloads with buffer pointer return types to
be generated. The swiftified return values currently return Span when
the return value is marked as nonescaping, despite this not being sound.
This is a bug that will be fixed in the next commit, as the issue is
greater than just for return values.

* Fix Span variant selection

There was an assumption that all converted pointers were either
converted to Span-family pointers, or UnsafeBufferPointer-family
pointers. This was not consistently handled, resulting in violating the
`assert(nonescaping)` assert when the two were mixed. This patch removes
the Variant struct, and instead each swiftified pointer separately
tracks whether it should map to Span or UnsafeBufferPointer.
This also fixes return pointers being incorrectly mapped to Span when
marked as nonescaping.
2025-01-13 08:08:36 -08:00
Henrik G. Olsson
ef9d2b744d Rename pointer bounds (#78210)
* Make pointer bounds non-experimental

* Rename @PointerBounds to @_SwiftifyImport

* Rename filenames containing PointerBounds

* Add _PointerParam exception to stdlib ABI test

* Add _PointerParam to stdlib API changes

* Rename _PointerParam to _SwiftifyInfo
2024-12-20 11:36:01 +01:00
Doug Gregor
62d8659b15 Update API/ABI stability checker output for correctly-printed ''rethrows'
We used to treat 'rethrows' like an attribute, printing it as
'@rethrows', which was incorrect. That's fixed now, so update the
API/ABI checker tests to account for that.
2024-12-15 08:21:10 -08:00
Guillaume Lessard
5e819aeea6 [stdlib] generalize isPOD() over suppressible protocols 2024-10-18 22:57:43 -07:00
Karoy Lorentey
0cb576773f [api-digester] Update classic ABI checker exception list 2024-10-08 11:11:04 -07:00
Doug Gregor
2e9ab88c4a Genereralize standard library ABI stability test for arm64 macOS
... and now that it is fixed for the platform I'm developing odd, add the
missing entries for typed throws on withUnsafe(Mutable)BufferPointer.
2024-08-16 21:28:30 -07:00
Allan Shortlidge
20d97556ae stdlib: Remove #if $TypedThrows guards.
https://github.com/swiftlang/swift/pull/72612 can be reverted because it is no
longer necessary for the interface of the stdlib to be compatible with
compilers without `$TypedThrows` support.
2024-07-08 16:52:52 -07:00
Nate Chandler
746cf2ff5b [BitwiseCopyable] Drop req from SIMD/Storage.
There are conformers to SIMDStorage (like that in the added test case)
which involve an Array (a type that can't conform to BitwiseCopyable).
So lift the constraint on SIMDStorage.  This in turn requires lifting
the constraint on SIMD (otherwise, e.g. `SIMD8<Scalar>` would fail to
conform since it has as a member some SIMD8Storage which is only
constrained to conform to `SIMDStorage`; the `SIMD8Storage`
associatedtype also cannot be constrained to `BitwiseCopyable` because
that storage may again not conform as in the test example).

rdar://128661878
2024-05-24 12:32:10 -07:00
Nate Chandler
b1fbe4ea91 [BitwiseCopyable] Remove underscore. 2024-04-25 11:44:15 -07:00
Karoy Lorentey
a681a3d45e [api-digester] Ritually confess our sins 2024-04-16 11:21:08 -07:00
Stephen Canon
a381589524 SE-0425 implementation (#72139) 2024-04-02 16:24:41 -04:00
Allan Shortlidge
a1dacc12d7 stdlib: Make typed throws ABI placeholders properly @usableFromInline.
Functions that are used in public `@inlinable` function bodies can't be marked
`@_spi` nor can they be made obsolete. Also, they must retain `rethrows` so
that use of these entry points from other `rethrows` functions is accepted.

Builds on https://github.com/apple/swift/pull/72365. Once we no longer have to
support pre-`$TypedThrows` compilers, all of this can be reverted.

Part of rdar://125138945
2024-03-27 14:57:56 -07:00
Karoy Lorentey
c2f8d733dc [test] Update api-digester false positives lists 2024-03-21 13:53:58 -07:00
Karoy Lorentey
74bd1e385c [test] Fix mismerge in old ABI checker’s expectation list 2024-03-18 15:27:29 -07:00
Karoy Lorentey
6e77f85f92 [abi] Update false positives list for api-digester based ABI/source stability tests 2024-03-18 11:09:07 -07:00
Kavon Farvardin
11220bb3d0 ABI Tests: include Copyable/Escapable in baseline 2024-03-14 23:10:44 -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
3f9d93df76 [api-digester] fix exception omission
Update test/api-digester/stability-stdlib-abi-without-asserts.test
2024-03-08 09:01:11 -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
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
Guillaume Lessard
fd726ccac3 [abi-digester] fix an exception
Update test/api-digester/stability-stdlib-abi-without-asserts.test
2024-03-05 09:24:13 -08:00
Guillaume Lessard
72e26f2d87 [api-digester] add more exceptions for typed throws 2024-03-05 03:06:42 -08:00
Guillaume Lessard
95c07e4688 [api-digester] add more exceptions for typed throws 2024-03-05 02:31:23 -08:00
Guillaume Lessard
e02d8ab799 [api-digester] add more exceptions for typed throws 2024-03-05 02:25:52 -08:00
Karoy Lorentey
a35741f4eb [test] Expect the phantom removal of _get*RetainCount functions 2024-02-27 13:18:28 -08:00
Guillaume Lessard
71640be109 Merge pull request #71363 from glessard/rdar115296219
[stdlib] properly rename validatingUTF8 to validatingCString
2024-02-07 14:37:23 -08:00
Guillaume Lessard
16af5e6a28 [test] silence api-digester false alarm 2024-02-03 16:19:05 -08:00
Nate Chandler
c8119e3c01 [stdlib] FixedWidthInteger is BitwiseCopyable. 2024-01-30 14:38:07 -08:00
Kuba Mracek
53ddf9bdf2 [embedded] Adjust stdlib stability test expectations after typed throws adoption 2024-01-18 20:56:20 -08:00
nate-chandler
7dd1d3f7c1 Merge pull request #70872 from nate-chandler/rdar19519745
[BitwiseCopyable] Infer and check constraint.
2024-01-16 07:01:31 -08:00
Nate Chandler
63de79c91e [stdlib] Pointers and SIMDs are bitwise copyable. 2024-01-15 17:08:32 -08:00
Doug Gregor
a30b623ee6 Implement typed throws support in _openExistential. 2024-01-14 14:32:49 -08:00
Doug Gregor
8912d4aa71 [SE-0413] Adopt typed throws in withoutActuallyEscaping(_:do:)
There is a small bug fix here in the identification of the catch node,
where the leading `{` of a closure was considered to be "inside" the
closure for code like

    { ... }()

causing us to assume that the call to the closure would catch the error
within the closure.

Other than that, introduce the thrown error type into the type checker's
modeling of `withoutActuallyEscaping(_:do:)`, and mirror that in the
library declaration.
2024-01-13 21:57:24 -08:00