Commit Graph

22458 Commits

Author SHA1 Message Date
Nate Cook
de749cea18 Don't reparent Sequence with BorrowingSequence
This eliminates the reparenting of Sequence with BorrowingSequence
for the time being
2026-02-24 16:17:37 -06:00
Nate Cook
7955b0c5a3 Add Reparenting feature to RuntimeModule 2026-02-24 11:57:52 -06:00
Nate Cook
6bb5cea3c8 Switch to SpanIterator for new BorrowingSequences
Adds a SpanIterator type and switches to use that for new borrowing
sequences, removing the BorrowingIterator customization for existing
stdlib sequence types. These existing sequences will just get the
borrowing adaptor, so as to continue with their existing iteration
model.
2026-02-23 19:22:44 -06:00
Nate Cook
ea006541d9 Add underestimatedCount and customContains
The BorrowingSequence protocol needs to include these two Sequence
customization points as well.
2026-02-23 12:59:43 -06:00
Nate Cook
897787df41 Merge branch 'main' into nate/reparented-borrowingsequence 2026-02-23 08:42:19 -06:00
Alastair Houghton
3a06cc5d4c Merge pull request #87365 from al45tair/eng/PR-170801141 2026-02-22 16:51:53 +00:00
Anthony Latsis
6dcd4c8737 Merge pull request #87213 from indextrown/fix-observation-doc-typo
[stdlib] Fix documentation typo in Observations.swift
2026-02-20 22:35:30 +00:00
Carl Peto
70dfbf87b5 [Runtime] Move source code doc comments to DocC (#87311)
rdar://126273038

<!--
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: Carl Peto <carlpeto@Carls-MacBook-Pro.local>
2026-02-20 12:15:42 -08:00
Nate Cook
b7b942a3e0 Merge branch 'main' into nate/reparented-borrowingsequence 2026-02-20 12:54:52 -06:00
Nate Cook
21510f0c35 Move availability on borrowingSequence extensions 2026-02-20 11:11:10 -06:00
Guillaume Lessard
e8b0853deb Merge pull request #86182 from indextrown/fix-debugdescription-doc-typo 2026-02-20 08:33:28 -08:00
Alastair Houghton
9c3c25f07f [Backtracing] If the backtracer crashes, backtrace it (once).
If the backtracer crashes, at present we get no clues as to what
went wrong.  This makes it very hard to debug.  Part of the reason
for this is that we were worried about it entering a recursive
backtracing loop, however not having any messages at all when
something goes awry is a bit of a problem.

To address this, have the backtracing code set an environment
variable to indicate that we're backtracing, then if we crash with
that variable set, disable the backtracer for the subsequent run
of the backtracer.  This means that if the initial backtracer
instance crashes, we will try to run at most one more instance to
backtrace *that*.

rdar://170801141
2026-02-20 15:01:32 +00:00
Kavon Farvardin
dde4f8e092 Merge pull request #87325 from kavon/use-suppassocwithdefaults
Stdlib: switch to SuppressedAssociatedTypesWithDefaults
2026-02-20 02:11:07 -08:00
Alastair Houghton
be16bbb99e Merge pull request #87310 from al45tair/eng/PR-170642627
[Backtracing] Add the ability for a `SymbolLocator` to find images.
2026-02-20 08:38:33 +00:00
Slava Pestov
7982ceda0a Merge pull request #87305 from slavapestov/stdlib-salvage
stdlib: Build with -solver-enable-crash-on-valid-salvage
2026-02-19 17:49:03 -05:00
Nate Cook
3746184cbc Re-enable availability checking in stdlib
(And disable in stdlib collection unit tests)
2026-02-19 12:39:33 -06:00
Alastair Houghton
1c34b0d0a6 Merge pull request #87258 from al45tair/eng/PR-169305717
[CompatibilityPacks] Don't export symbols.
2026-02-19 18:21:21 +00:00
Anthony Latsis
e1d911e1d8 Merge pull request #87215 from oksunwoo/main
[stdlib] Fix typo in Task+TaskExecutor doc comment
2026-02-19 18:04:21 +00:00
Rintaro Ishizaki
c8206d1262 [stdlib] Use response files for availability macros
`-define-availability` arguments for stdlib modules can be very long,
which may exceed Windows command-line length limits and cause build
failures. Use response files to avoid this.
2026-02-18 21:57:54 -08:00
Kavon Farvardin
0ae044a555 Stdlib: switch to SuppressedAssociatedTypesWithDefaults
Ever since `_BorrowingSequence` and friends landed in the standard library,
it's introduced a primary associated type that is suppressed. Since the mangling
of generic signatures is different depending on whether you're using
`SuppressedAssociatedTypes` and the `-WithDefaults` version, we should introduce
it with the new mangling in-place. It's also source breaking to make this switch
happen later on, since defaults will get assumed where they were not before.

rdar://170650908
2026-02-18 21:14:39 -08:00
Franz Busch
0deb770c54 Merge pull request #87082 from jamieQ/astream-cancel-docs
[NFC][Concurrency]: add note about deadlock risk for AsyncStream.onTermination
2026-02-19 02:40:42 +01:00
Alastair Houghton
245b5e0766 [Backtracing] Add the ability for a SymbolLocator to find images.
This is better than the `alternativePaths` mechanism because it means that
a client of the `Runtime` module can do its own thing, which might even
mean fetching things from a remote server or decompressing files or any
other thing we might find useful.

rdar://170642627
2026-02-18 16:59:52 +00:00
Rintaro Ishizaki
0030071121 Merge pull request #87299 from rintaro/stdlib-noncopyable-generics-2
[stdlib] Stop enabling NoncopyableGenerics2 "experimental" feature
2026-02-18 08:44:49 -08:00
Nate Cook
b08df0e09a Merge branch 'main' into nate/reparented-borrowingsequence 2026-02-18 10:36:29 -06:00
Slava Pestov
0fdcf10b1a stdlib: Build with -solver-enable-crash-on-valid-salvage 2026-02-18 11:08:09 -05:00
Alastair Houghton
19b823c9db [Backtracing][PDB] Fix 32-bit Intel build. (#87304) 2026-02-18 07:14:00 -08:00
Alastair Houghton
cb57f30912 [CompatibilityPacks] Don't export symbols.
Mark the symbols in libswiftCompatibilityPacks.a as hidden.

rdar://169305717
2026-02-18 10:41:30 +00:00
Alastair Houghton
eda633695b Merge pull request #87216 from al45tair/eng/PR-168454023
[Backtracing][PDB] Add PDB code and `SymbolLocator`.
2026-02-18 07:58:26 +00:00
Rintaro Ishizaki
9822843aed [stdlib] Stop enabling NoncopyableGenerics2 "experimental" feature
`NoncopyableGenerics2` is a BASELINE_LANGUAGE_FEATURE since Jul., 2024.
2026-02-17 21:03:35 -08:00
Nate Cook
413033fd30 Merge branch 'main' into nate/reparented-borrowingsequence 2026-02-17 22:44:48 -06:00
Konrad `ktoso` Malawski
56994baf9e [Concurrency] Fix condfail since missing builtin call guard (#87272)
7b9281fcb8
was applied to resolve a condfail but it wasn't done in all places, also
apply it to the new typed throws version

rdar://166244033

FYI @gottesmm
2026-02-17 20:21:17 -08:00
Alastair Houghton
042861d752 [Backtracing][PDB] Fix a couple of tests.
We can't test the alternate image support for ELF, because that's been
removed in favour of `SymbolLocator`/`SymbolSource`.

Also we must pass `/opt:icf` in the symbolicated backtrace test when
using PDB, otherwise we corrupt the metadata.

Finally fix a mistake in `Utils.swift` where we were crashing if the
environment variable in question wasn't set.

rdar://168454023
2026-02-17 18:51:17 +00:00
Alastair Houghton
e7f603fd25 [Backtracing][PDB] For ELF, always return the image file.
ELF images typically do contain symbols, unlike PE-COFF images.

rdar://168454023
2026-02-17 12:24:51 +00:00
Alastair Houghton
2d6d395f75 [Backtracing] Fix Linux build.
The fix for the previous Linux build problem introduced a new one.

rdar://168454023
2026-02-17 10:50:56 +00:00
Alastair Houghton
af322cf942 [Backtracing][PDB] Remove ELF-specific lookupSymbol().
We don't need the ELF-specific function any more, so get rid of it.

Also fix a typo.

rdar://168454023
2026-02-17 10:50:56 +00:00
Alastair Houghton
d380cde01a [Backtracing][PDB] Remove debugging things.
I'd told the RuntimeModule to build with debug information while
working on debugging it.  We don't want that in the build.

rdar://168454023
2026-02-17 10:50:56 +00:00
Alastair Houghton
b89b5e13bd [Backtracing][PDB] Fix-ups after rebasing.
A few tweaks required after rebasing on top of Carl's work on
cross-platform symbolication.

rdar://168454023
2026-02-17 10:50:56 +00:00
Alastair Houghton
487e173a26 [Backtracing][PDB] Scan the main symbol stream as well.
Without scanning the main symbol stream, we get weird names for the
Swift functions in the backtrace, because the compiler generates C++-style
names for them.  We actually want the mangled names, if possible, which
only seem to be in the symbol stream, so scan that as well and use it
to find mangled names.

rdar://168454023
2026-02-17 10:50:56 +00:00
Alastair Houghton
acdaeef626 [Backtracing][PDB] Add PDB code and SymbolLocator.
Added the PDB reading code and also a `SymbolLocator` type that
allows us to locate symbols for a given image.

rdar://168454023
2026-02-17 10:50:55 +00:00
Nate Cook
408ce64359 Add disfavored overload to uncondtional makeBorrowingIterator
This is necessary to disambiguate when calling the method
for CxxBorrowingSequences in a non-generic context. The `Sequence`
extension is unconditional, and I haven't been able to figure
out another tie-breaker for other protocol-provided methods.

Identified in test/Interop/Cxx/stdlib/use-std-vector.swift
2026-02-16 23:30:12 -06:00
Nate Cook
dc5be12c75 Remove conformances for conditonal sequences 2026-02-16 13:25:47 -06:00
Konrad `ktoso` Malawski
68c8641321 Task Cancellation Shields (#85637)
This is a follow up from the "async" `deinit` work, which will allow us
to guarantee cleanup code to run in deinitializers, even if they need to
call asynchronous code, and even if they may be run in a task that was
cancelled: by "shielding" it from cancellation.

This is incomplete, the child handling needs some more love.

SE proposal: https://github.com/swiftlang/swift-evolution/pull/3037/
2026-02-16 09:35:27 +09:00
Saleem Abdulrasool
36dad442b5 Merge pull request #87199 from compnerd/flat-land
runtime: repair the windows x86 build
2026-02-13 13:56:58 -08:00
Nate Cook
df74f645e8 De-underscore BorrowingIterator and friends 2026-02-13 14:27:54 -06:00
Nate Cook
ebd8bb4529 Merge branch 'main' into nate/reparented-borrowingsequence 2026-02-13 13:08:27 -06:00
Nate Cook
223969785d Update to the correct release availability 2026-02-13 12:23:41 -06:00
Mike Ash
d21b27550e Merge pull request #87198 from mikeash/artificial-subclass-naming-fix
[Runtime] Don't skip artificial subclasses in swift_getTypeName.
2026-02-13 13:19:33 -05:00
Susana Monteiro
f0fa33c3ce Merge pull request #87186 from susmonteiro/susmonteiro/contiguous-borrowing-sequence
[cxx-interop] Specialize `nextSpan()` for contiguous sequences
2026-02-13 17:31:35 +00:00
Alex Hoppen
80abc59471 Merge pull request #87020 from glessard/filter-closures-typed-throws
[stdlib] Generalize the `filter(_:)` functions for typed throws
2026-02-13 18:08:50 +01:00
indextrown
3b1c0fb80d [stdlib] Fix documentation typo in Observations.swift 2026-02-13 23:34:21 +09:00