Commit Graph

7706 Commits

Author SHA1 Message Date
David Smith
215620af3d [6.2] Fix lengthOfBytes(using:) semantics (#83340)
(cherry picked from commit ea7c3d4ec8)
2025-07-25 22:22:51 -07:00
Michael Ilseman
7983566de5 [6.2] Better docs for UTF8Span (#83184) (#83209)
Cherry pick of https://github.com/swiftlang/swift/pull/83184

<!--
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!
-->

Co-authored-by: Alex Martini <amartini@apple.com>
2025-07-23 03:48:20 -07:00
Stephen Canon
59e64904dc [6.2] Use unsigned arithmetic for Span bounds checks (#83215)
This allows us to eliminate a comparison;
https://github.com/swiftlang/swift/pull/83172 will allow the compiler to
do it for us instead in the future.

**Explanation:** Changes the implementation of Span's subscript bounds
checks to use a single unsigned comparison instead of two signed
compares.
**Scope:** Narrow. Does not apply to any other API.
**Issues:** rdar://156068535 
**Original PRs:** https://github.com/swiftlang/swift/pull/83150
**Risk:** Low. Minor implementation tweaks to API that is not widely
adopted.
**Testing:** CI
**Reviewers:** @glessard @meg-gupta
2025-07-23 03:38:07 -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
2a88f0e764 [stdlib] add OutputSpan to backdeployment library 2025-07-16 17:19:42 -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
Alastair Houghton
eefdd69c8d Merge pull request #82915 from al45tair/eng/PR-151147606-take2
[Concurrency] Remove custom global executors from 6.2.
2025-07-14 16:20:57 +01: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
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
8c7d0db816 [stdlib] make OutputRawSpan changes from SE-0485 2025-07-11 19:03:02 -07:00
Guillaume Lessard
f11f3a9b72 [stdlib] make OutputSpan changes from SE-0485 2025-07-11 19:03:02 -07:00
Guillaume Lessard
ea4083777b [stdlib] internal UnsafeRawBufferPointer tweaks 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
42c5988161 [stdlib] add OutputRawSpan 2025-07-11 19:03:01 -07:00
Guillaume Lessard
850bb23d48 [stdlib] add OutputSpan 2025-07-11 19:03:00 -07:00
Guillaume Lessard
ccffb19afd [stdlib] alignment-checking functions for pointers
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
2025-07-11 19:03:00 -07: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
1830334aa3 Merge pull request #82883 from glessard/rdar155275054-default-inits-allspans-62
[stdlib, 6.2] Default initializers for Span-family types
2025-07-08 18:48:07 -07:00
Guillaume Lessard
9a6ea014ba [stdlib] update doc-comments and add a code comment 2025-07-08 14:34:49 -07:00
Guillaume Lessard
cd1b2d84f6 [stdlib] make makeContiguousUTF8 stricter 2025-07-08 14:32:27 -07:00
Guillaume Lessard
234dc4145f [gardening] conditional compilation spelling tweak 2025-07-08 14:32:26 -07:00
Guillaume Lessard
3e59e93ee8 [stdlib] add no-parameter initializers for Span types
This was an addition in SE-0485.
2025-07-08 09:47:52 -07:00
Guillaume Lessard
f82f761d0a Merge pull request #82844 from glessard/rdar155198823-mutableSpan-unwrap
[stdlib, 6.2] fix some unsafe errors
2025-07-07 18:07:43 -07:00
Guillaume Lessard
86bf7148fa [stdlib, 6.2] add span properties for backdeployment (#82748)
- Explanation:
Makes as many of the `span`, `bytes`, `mutableSpan` and `mutableRawSpan`
properties as possible available to backdeployed targets. This is
possible when the implementation only relies on pre-existing code.

- Resolves: rdar://153654652 (https://forums.swift.org/t/80513)
- Risk: low
- Main branch PR: https://github.com/swiftlang/swift/pull/82598
- Reviewed by: @atrick 
- Testing: existing tests
2025-07-07 14:04:36 -04:00
Guillaume Lessard
74acd4104f [stdlib] fix some unsafe errors 2025-07-07 10:30:37 -07:00
Alastair Houghton
8eb879831c Merge pull request #81940 from al45tair/eng/PR-152498657
Rename SwiftStdlibCurrentOS to StdlibDeploymentTarget.
2025-07-07 12:04:38 +01:00
Alastair Houghton
0813e95569 Merge pull request #81440 from al45tair/currentos-availability
[Concurrency][Stdlib] Add SwiftStdlibCurrentOS availability, use it.
2025-07-07 12:04:00 +01:00
Henrik G. Olsson
43d8b13cf1 Merge pull request #82644 from hnrklssn/cherry-pick-macro-adjustment-check
Cherry-pick "Merge pull request #81855 from hnrklssn/swiftify-availability-check-sdk"
2025-07-03 11:07:43 -07:00
David Smith
f8c1df8e09 [6.2] Native implementation of -lengthOfBytesUsingEncoding (#82747) 2025-07-03 05:08:37 -07:00
Alex Martini
6b838fb12e Merge pull request #82636 from amartini51/typo_154473231_CHERRYPICK
Fix repeated words in documentation

Fixes: rdar://154473231
2025-07-02 23:02:52 -07:00
Guillaume Lessard
fbe73da41d Merge pull request #82597 from glessard/rdar145487409-inlinearray-plus-mutablespan-62
[6.2, stdlib] Remove _withUnsafeBufferPointer APIs on InlineArray
2025-07-01 14:10:04 -07:00
Stephen Canon
8da8df8a26 Replace some precondition with _precondition in the stdlib. (#82641) (#82656)
**Explanation:** Replace some `precondition` usage that slipped into the
stdlib with `_precondition`
**Resolves:** rdar://152529291
**Main Branch PR:** #82641
**Risk:** Very Low.
**Reviewed By:** @Azoy 

Cherry-pick from https://github.com/swiftlang/swift/pull/82641
2025-07-01 16:32:32 -04:00
Henrik G. Olsson
9de099a4b0 Merge pull request #81855 from hnrklssn/swiftify-availability-check-sdk
[Swiftify] Adjust _SwiftifyImport invocation to align with the signature

(cherry picked from commit e9ba8f8a03)
2025-06-30 12:02:55 -07:00
Alex Martini
bdfc10d366 Fix repeated text
(cherry picked from commit 3928ddfeb4)
2025-06-30 09:47:43 -07:00
Guillaume Lessard
ff7596c9a4 [stdlib] improve more accessor declarations 2025-06-28 03:52:20 -07:00
Guillaume Lessard
ca4f25ffae [stdlib] simplify borrowing accessors 2025-06-28 03:51:39 -07:00
Guillaume Lessard
3c33b12662 [stdlib] improve accessor declarations 2025-06-28 03:51:38 -07:00
Alejandro Alonso
496aa11ec3 Adjust ABI test and guard address of property 2025-06-28 03:51:16 -07:00
Alejandro Alonso
b99ec0e41e Update InlineArray.swift 2025-06-28 03:51:16 -07:00
Alejandro Alonso
050622dd15 Update InlineArray.swift 2025-06-28 03:51:16 -07:00
Alejandro Alonso
f84e621656 Update InlineArray.swift 2025-06-28 03:51:15 -07:00
Alejandro Alonso
f546bc88e9 Remove underscored with buffer pointer APIs on InlineArray 2025-06-28 03:51:15 -07:00
Guillaume Lessard
7970bd4c92 [stdlib] name your constants 2025-06-27 10:23:51 -07:00
Guillaume Lessard
2eb8d2bdcb [gardening] labels for conditional compilation markers 2025-06-27 10:22:53 -07:00
Guillaume Lessard
3d27453b23 [stdlib] adjust small string for contiguity 2025-06-27 10:22:47 -07:00