Make `init(catching:)` and `get()` use typed throws. The former infers
the `Failure` type from the closure provided (once full type inference
is in place) and the latter only throws errors of the `Failure` type.
* Adds RangeSet/DiscontiguousSlice to the stdlib
* Remove redundant DiscontiguousSlice.Index: Comparable conformance
* Attempt to fix embedded build
* Attempt to fix macOS test failures
* Fix Constaints/members.swift failure on linux
* Add exceptions to ABI/source checker to fix macOS tests
* Fix incremental dependency test failure
* Remove inlining/unfreeze implementation for future improvements
* Simplify indices(where:) implementation
* Address review feedback
* Add test for underscored, public slice members
* Address feedback on inlining, hashing, and initializing with unordered arrays
* Fix ABI checker issues
* Remove MutableCollection extension for DiscontiguousSlice
* Make insertion return a discardable Bool
* Fix ABI checker tests
* Fix other ABI checker tests due to dropping MutableCollection subscript
This is the 3rd attempt to fix the mismatch, where the actual definition
(e.g. `swift_retainCount`) are defined with C calling-convention and the
callers wrongly expect Swift calling-convention.
The 1st fix broke ABI compatibility by introducing new symbol references
from app-side without any availability checks.
The 2nd fix broke lldb's retain counting feature due to new x-ref to
Clang module in serialized function body by `@_alwaysEmitIntoClient`.
This attemps to avoid introducing serialized x-ref to Clang module by
using new `@_extern(c)` attribute.
Resolves rdar://113910821
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
* [Stdlib] Add some prespecializations to the stdlib
This adds prespecializations for commonly used types to the stdlib
* Add false positives to ABI checker ignore list
* Update multithread_module.swift
* Update multithread_module.swift
* Update multithread_module.swift
* initial
* it works
demangling mostly works
fix dots
printing works
add tests
add conformance to AnyKeyPath
implement SPI
subscripts fully work
comments
use cross platform image inspection
remove unnecessary comment
fix
fix issues
add conditional conformance
add types
try to fix the api-digester test
cr feedback: move impls behind flag, remove addChain(), switch statement, fallthrough instead of if-elses, move import
cr feedback: refactor switch statement
fix #ifdef
reindent, cr feedback: removes manual memory management
fix missing whitespace
fix typo
fix indentation issues
switch to regexes
checks should test in on all platforms
print types in subscripts
add test for empty subscript
Update test/api-digester/stability-stdlib-abi-without-asserts.test
Co-authored-by: Xiaodi Wu <13952+xwu@users.noreply.github.com>
add commas
fix failing test
fix stdlib annotation
cr feedback: remove global, refactor ifdef
cr feedback: switch back to manual memory management
switch to 5.8 macro
add new weakly linked functions to the allowlist
fix one more failing test
more cr feedback
more cr feedback
* fix invisible unicode
In theory this is a source break if someone had a weird custom
conforming type, but I suspect in practice conformances to
this protocol are never defined.
The reason we want this requirement is that often you will see
code like the following:
protocol Point {
associatedtype Scalar: SIMDScalar
associatedtype Vector: SIMD where Vector.Scalar == Scalar
}
extension Point where Vector == SIMD2<Scalar> { ... }
When `Vector` is equated with `SIMD2<Scalar>`, we get an infinite
sequence of implied same-type requirements:
Vector.MaskStorage == SIMD2<Scalar.MaskScalar>
Vector.MaskStorage.MaskStorage == SIMD2<Scalar.MaskScalar.MaskScalar>
...
The protocol fails to typecheck with an error because the requirement
machine cannot build a rewrite system.
If SIMDScalar requires that MaskScalar.MaskScalar == MaskScalar, then
we instead get
Vector.MaskStorage == SIMD2<Scalar.MaskScalar>
Vector.MaskStorage.MaskStorage == SIMD2<Scalar.MaskScalar>
Vector.MaskStorage.MaskStorage == Vector.MaskStorage
...
Which ties off the recursion.
In theory, a more advanced implementation could represent this kind of
infinite recursion in 'closed form', but we don't have that yet, and I
believe adding this same-type requirement makes sense anyway.
Fixes rdar://problem/95075552.
The type `Hasher._Core` is `@frozen` but its stored properties are `private`, which currently makes them show up in api-digester ABI reports, leading to failures like this one:
```
+Var Hasher._Core._buffer has mangled name changing from 'Swift.Hasher._Core.(_buffer in _A19879A32F7D08A6DD54BABBA00BBA0C) : Swift.Hasher._TailBuffer' to 'Swift.Hasher._Core.(_buffer in _16630011A164FCBB1F12E5E0A3A7C863) : Swift.Hasher._TailBuffer'
```
These names aren't ABI impacting, so this checker probably should ignore their name changes. (The property names do appear in the .swiftinterface files, but IIUC the only their type and ordering matters.)
These ever-changing unstable ids make it impossible to add an entry to the expectation list that would allow these tests to pass. Work around this issue by postprocessing the reports to replace the unstable parts with the constant string `#UNSTABLE ID#`.
rdar://82552099
These were defined for both FixedWidthInteger and FixedWidthInteger & SignedInteger for source compatibility with Swift 3; the latter set probably should have been removed when we stabilized the ABI, but were not. We can't easily remove them entirely (because we need them for ABI stability now), but we can mark them unavailable so that the typechecker doesn't have to consider them..
* Casting from AnyHashable to AnyHashable should never create another wrapper
This adds a conformance for _HasCustomAnyHashableRepresentation to
AnyHashable that simply returns self. This ensures that anytime
you try to create a new AnyHashable wrapper for an existing
AnyHashable, you just get back the original.
Resolves rdar://75180619
* Move the `Struct AnyHashable` change to `without-asserts` list
As suggested by @lorentey