Commit Graph

3245 Commits

Author SHA1 Message Date
Jonathan Grynspan
a028ae16f4 [6.2.1] Add Equatable and Hashable conformance to GUID. 2025-10-10 08:38:23 -04:00
Philippe Hausler
838cb7a91b Revert "[Observation] Ensure deinitialized Observable types don't leave active observations in memory (#82752)" (#83492)
This reverts commit a349e64039.

This is in concert of https://github.com/swiftlang/swift/pull/83436

<!--
If this pull request is targeting a release branch, please fill out the
following form:

https://github.com/swiftlang/.github/blob/main/PULL_REQUEST_TEMPLATE/release.md?plain=1

Otherwise, replace this comment with a description of your changes and
rationale. Provide links to external references/discussions if
appropriate.
If this pull request resolves any GitHub issues, link them like so:

  Resolves <link to issue>, resolves <link to another issue>.

For more information about linking a pull request to an issue, see:

https://docs.github.com/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
-->

<!--
Before merging this pull request, you must run the Swift continuous
integration tests.
For information about triggering CI builds via @swift-ci, see:

https://github.com/apple/swift/blob/main/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift!
-->
2025-08-08 17:13:13 -07:00
Max Desiatov
ab7cd238fd [6.2] test/CMakeLists.txt: run Embedded Swift for Wasm tests (#83287)
Cherry-pick of #83128, #82399, and #82878, merged as ea6ca2b5db, 0c4e56174b, and e34eb3331f respectively.

**Explanation**: Currently `test/CMakeLists.txt` can only set `SWIFT_LIT_ARGS` for all tests uniformly. This means that we can't have tests for Embedded Swift with a different set of `lit.py` arguments.

Also, create new `check-swift-embedded-wasi` target from `test/CMakeLists.txt`, tweak `lit.cfg` to support WASI Clang resource dir, exclude unsupported tests based on `CPU=wasm32` instead of `OS=wasi`.

**Scope**: Limited to Embedded Swift test suite.
**Risk**: Low, due to limited scope.
**Testing**: #82878 was incubated on `main` for 2 weeks, #82399 for 3 weeks with no disruption, #83128 merged this week, but enables all these tests on CI, which are consistently passing.
**Issue**: rdar://156585717
**Reviewer**: @bnbarham
2025-07-26 09:48:47 +01:00
David Smith
215620af3d [6.2] Fix lengthOfBytes(using:) semantics (#83340)
(cherry picked from commit ea7c3d4ec8)
2025-07-25 22:22:51 -07:00
David Smith
155d7fbbcf [6.2] Make sure SwiftObject doesn't crash when compared to tagged pointers (#83271)
Cherry pick of https://github.com/swiftlang/swift/pull/83269
2025-07-25 01:11:46 -07:00
Guillaume Lessard
a345e3a8b3 Merge pull request #83000 from glessard/rdar147780495-OutputSpan-updates-62
[SE-0485, 6.2] OutputSpan and OutputRawSpan
2025-07-17 19:12:58 -07:00
Guillaume Lessard
66e62302fa [test] OutputRawSpan tests 2025-07-16 17:19:41 -07:00
Guillaume Lessard
5ba72f267f Merge pull request #83023 from glessard/rdar155474776-extracting-62
[SE-0488, 6.2] Implementation for SE-0488
2025-07-15 13:59:29 -07:00
Guillaume Lessard
6414aa226f [stdlib] rename RawSpan.extracting functions 2025-07-12 22:58:00 -07:00
Guillaume Lessard
ac3e47612c [stdlib] rename Span.extracting functions 2025-07-12 22:58:00 -07:00
Guillaume Lessard
746324b4ba [test] fix test of InlineArray initializer 2025-07-11 19:03:03 -07:00
Guillaume Lessard
402a0cf2c8 [stdlib] remove bulk-update from MutableRawSpan per SE-0485 2025-07-11 19:03:03 -07:00
Guillaume Lessard
34a26d6d9a [stdlib] remove bulk-update from MutableSpan per SE-0485 2025-07-11 19:03:03 -07:00
Guillaume Lessard
3b4279c671 [stdlib] rename MutableRawSpan.extracting functions 2025-07-11 19:03:03 -07:00
Guillaume Lessard
05fe6fa522 [stdlib] rename MutableSpan.extracting functions 2025-07-11 19:03:03 -07:00
Guillaume Lessard
f11f3a9b72 [stdlib] make OutputSpan changes from SE-0485 2025-07-11 19:03:02 -07:00
Guillaume Lessard
a2a9f46907 [test] simplify OutputSpan-InlineArray test 2025-07-11 19:03:02 -07:00
Guillaume Lessard
d078734051 [stdlib] InlineArray consumed by OutputSpan 2025-07-11 19:03:01 -07:00
Guillaume Lessard
9f9565f4b2 [stdlib] in-place initializer for InlineArray 2025-07-11 19:03:01 -07:00
Guillaume Lessard
0fc95ef94e [test] OutputSpan tests 2025-07-11 19:03:01 -07:00
Philippe Hausler
a349e64039 [Observation] Ensure deinitialized Observable types don't leave active observations in memory (#82752)
Explanation:
This ensures a potential leak with SwiftUI and other systems using
Observation do not leak observation closures when the potential
Observable instances used are only weakly referenced inside the tracking
closure.
 
Scope:
This is limited to the runtime behavior of Observable types and has no
ABI or language level interactions.

Issues:
rdar://112167556

Original PRs:
https://github.com/swiftlang/swift/pull/79823
https://github.com/swiftlang/swift/pull/82307

Risk:
Low - This is very targeted to just Observation, however it is a
behavioral change which does not make this a zero risk change.

Testing:
New unit tests were added to catch at least some of the potential cases
this issue can occur with.
2025-07-10 17:14:27 -04:00
Guillaume Lessard
b78124470c Merge pull request #82896 from glessard/rdar154331399-makeReallyContiguous-62
[stdlib, 6.2] Make String.makeContiguousUTF8() strictly true
2025-07-09 15:47:15 -07:00
Guillaume Lessard
c90cb5862e [test] small string compatibility for 32-bit targets 2025-07-08 14:34:50 -07:00
Guillaume Lessard
ccab81d134 [test] immortal no-parameter Span initializers 2025-07-08 09:48:00 -07:00
Guillaume Lessard
0a13d1e8ba [stdlibUnittest] generalize expectNil(_:) 2025-07-01 15:30:45 -07:00
Guillaume Lessard
a3a7af3bd6 [test] shorten a 32-bit small string (sometimes) 2025-06-27 10:23:51 -07:00
Guillaume Lessard
23ce3243a3 [test] adjust String span tests 2025-06-27 10:22:36 -07:00
Guillaume Lessard
484d7c7d46 Merge pull request #82422 from glessard/rdar153219174-UMBP-mutableSpan-62
[stdlib, 6.2] add missing computed properties (again)
2025-06-25 14:44:48 -07:00
Guillaume Lessard
5046c2a529 [stdlib] add UMBP.mutableSpan accessor 2025-06-23 11:20:48 -07:00
Guillaume Lessard
7ee3f85b7e [stdlib] add URMBP.mutableBytes accessor 2025-06-23 11:20:47 -07:00
Guillaume Lessard
9de70180f7 Revert "Merge pull request #82284 from glessard/rdar153219174-UMBP-mutableSpan-62"
This reverts commit 845b68a7c4, reversing
changes made to 3d1c592456.
2025-06-18 13:55:44 -07:00
Guillaume Lessard
ea14407cb1 [stdlib] add UMBP.mutableSpan accessor 2025-06-17 15:57:52 -07:00
Guillaume Lessard
7ab45ca442 [stdlib] add URMBP.mutableBytes accessor 2025-06-17 15:57:52 -07:00
finagolfin
6611ea97e9 [android][test] Fix or disable the remaining failing tests on the Android CI (#81398)
Also, fix and enable `IRGen/lto_autolink` for all non-Wasm targets and
`IRGen/static_initializer` for aarch64.

This should get [the community Android
CI](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-24.04-android-build/)
green
[again](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-24.04-android-arm64/).
2025-06-11 21:52:04 +05:30
Guillaume Lessard
4bc3eadc96 [test] UTF8Span from inline-stored Substring instances 2025-06-09 14:19:41 -07:00
Guillaume Lessard
d587809417 [test] UTF8Span from inline-stored String instances 2025-06-09 14:19:40 -07:00
Guillaume Lessard
4ecf66d4b0 [stdlibUnittest] generalize expectNotNil(_:)
Generalizes it for non-copyable and non-escapable values.
2025-06-09 14:19:39 -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
Pavel Yaskevich
d8642fce19 [Tests] NFC: Update all of the test-cases improved by changes to generic argument mismatch handling
(cherry picked from commit 4132aa04f9)
2025-06-03 09:33:13 -07:00
Pavel Yaskevich
a6827c605d [CSSimplify] Detect when generic argument mismatch applies to argument and produce a tailed fix
The problem detection logic currently expects `generic argument #<N>`
location to always be associated with two generic types, but that
is not always the case, this locator element is sometimes used for
i.e. optional object types and pointer `Pointee` type when types
appear in argument positions. This needs to be handled specifically.

Resolves: rdar://82971941
(cherry picked from commit ded6158cc3)
2025-06-03 09:33:13 -07:00
Erik Eckstein
09d2464578 SILGen: insert an end_lifetime in the throw-branch of a Builtin.emplace
When the called closure throws an error, it needs to clean up the buffer.
This means that the buffer is uninitialized at this point.

We need an `end_lifetime` so that the move-only checker doesn't insert a wrong `destroy_addr` because it thinks that the buffer is initialized.

Fixes a mis-compile.

rdar://151461109
2025-05-19 13:47:49 +02:00
Slava Pestov
874449374e RemoteInspection: Support for parameter packs 2025-05-09 14:50:19 -04:00
Nate Cook
c8c035ec32 [6.2][stdlib] Allow a default for optional interpolations (#81360)
Cherry-pick of #80547 for the 6.2 release branch.

---

Explanation: This cherry picks the implementation of SE-0477 to add a
string interpolation method with a `default:` parameter for optional
interpolation values.
Main Branch PR: https://github.com/swiftlang/swift/pull/80547
Risk: Low.
Reviewed By: @stephentyrone 
Resolves: rdar://150865613
Testing: New tests for the string interpolations and fix-its.
2025-05-09 12:10:58 -05:00
Stephen Canon
88e29fafc9 [6.2] Add static .nanoseconds(_: Double) to Duration (#81210) (#81236)
SE-0329 defines the following static factory methods:
```
public static func seconds<T: BinaryInteger>(_ seconds: T) -> Duration
public static func seconds(_ seconds: Double) -> Duration
public static func milliseconds<T: BinaryInteger>(_ milliseconds: T) -> Duration
public static func milliseconds(_ milliseconds: Double) -> Duration
public static func microseconds<T: BinaryInteger>(_ microseconds: T) -> Duration
public static func microseconds(_ microseconds: Double) -> Duration
public static func nanoseconds<T: BinaryInteger>(_ value: T) -> Duration
```
For no good reason, the obvious additional method:
```
public static func nanoseconds(_ nanoseconds: Double) -> Duration
```
was omitted. After talking this through with the LSG, we have decided
that this is simply a bug, and we will add this method without formal
evolution review.
2025-05-02 15:17:45 -07:00
Guillaume Lessard
c5acba54fa Merge pull request #80777 from glessard/rdar138440979-MutableSpan-mutableBytes
[6.2, SE-0467] add mutableBytes to MutableSpan
2025-04-30 09:46:44 -07:00
Guillaume Lessard
1dda72dceb Merge pull request #81172 from glessard/rdar150282203-false-positive-test-failure-6.2
[6.2, test] eliminate the possibility of a false positive
2025-04-29 18:54:46 -07:00
Guillaume Lessard
b442d3177b Merge pull request #80740 from glessard/rdar137710901-addressable-span-properties
[6.2, SE-0456, -0467] enable span properties for inline-storage types
2025-04-29 12:29:34 -07:00
Guillaume Lessard
53eacb58b1 [test] eliminate the possibility of a false positive 2025-04-29 10:45:35 -07:00
Guillaume Lessard
4e0e2ee427 [test] adjust test values 2025-04-18 10:45:00 -07:00
Guillaume Lessard
637f0279ad [test] remove an unnecessary feature flag 2025-04-18 10:45:00 -07:00