swift-ci
35563fca45
Merge remote-tracking branch 'origin/main' into rebranch
2022-05-18 11:13:44 -07:00
Karoy Lorentey
07ffddebae
Merge pull request #58954 from lorentey/string-bincompat-workarounds
...
[stdlib] Work around binary compatibility issues with String index validation fixes in 5.7
2022-05-18 11:09:44 -07:00
swift-ci
d62f2b0757
Merge remote-tracking branch 'origin/main' into rebranch
2022-05-17 20:13:36 -07:00
Karoy Lorentey
50c2399a94
[stdlib] Work around binary compatibility issues with String index validation fixes in 5.7
...
Swift 5.7 added stronger index validation for `String`, so some illegal cases that previously triggered inconsistently diagnosed out of bounds accesses now result in reliable runtime errors. Similarly, attempts at applying an index originally vended by a UTF-8 string on a UTF-16 string now result in a reliable runtime error.
As is usually the case, new traps to the stdlib exposes code that contains previously undiagnosed / unreliably diagnosed coding issues.
Allow invalid code in binaries built with earlier versions of the stdlib to continue running with the 5.7 library by disabling some of the new traps based on the version of Swift the binary was built with.
In the case of an index encoding mismatch, allow transcoding of string storage regardless of the direction of the mismatch. (Previously we only allowed transcoding a UTF-8 string to UTF-16.)
rdar://93379333
2022-05-17 19:25:10 -07:00
David Smith
9dd8d3ad1a
Actually slice things in _StringGutsSlice
2022-05-17 14:31:11 -07:00
swift-ci
593cc04070
Merge remote-tracking branch 'origin/main' into rebranch
2022-05-15 13:33:55 -07:00
유재호(예거)
2f30304375
[stdlib] Add missing terminating quotation character in examples ( #58927 )
2022-05-15 13:32:22 -07:00
swift-ci
d1160b6764
Merge remote-tracking branch 'origin/main' into rebranch
2022-05-14 11:53:25 -07:00
Ole Begemann
46c472f408
Reintroduce intentional typo in Unicode doc comment
...
This reintroduces an intentionally misspelled word in a doc comment for the `Unicode.Scalar.Properties.nameAlias` property. This "typo" was accidentally "fixed" in be13b470aa .
2022-05-13 22:23:17 +02:00
Alex Martini
950b7160c2
Correct the expected output in an example.
2022-05-12 10:35:55 -07:00
swift-ci
9f25a30e82
Merge remote-tracking branch 'origin/main' into rebranch
2022-05-11 15:21:21 -07:00
swift-ci
a62349a998
Merge pull request #58619 from Jager-yoo/revise-result-doc
...
[stdlib] Revise: applied trailing closure syntax to some examples in Result.swift
2022-05-11 14:15:27 -07:00
Jager-yoo
60dc7cda12
Revise: applied trailing closure syntax to some examples
...
- For clearer closure style with shorthand argument names.
2022-05-12 02:58:05 +09:00
Karoy Lorentey
063c8456a1
[stdlib] Take out primary associated types on LazySequenceProtocol/LazyCollectionProtocol for now
2022-05-09 18:09:21 -07:00
Karoy Lorentey
655f085c87
[stdlib] LazySequenceProtocol: Take out duplicate where clause
2022-05-09 18:07:10 -07:00
Karoy Lorentey
9f177d1243
Update stdlib/public/core/Codable.swift
...
Co-authored-by: Ben Rimmington <me@benrimmington.com >
2022-05-09 18:07:09 -07:00
Karoy Lorentey
191eaaddfd
[stdlib] Don’t mark Key as primary on Keyed*ContainerProtocol
2022-05-09 18:07:09 -07:00
Karoy Lorentey
7a7ebd8970
[stdlib] Adopt primary associated types in the stdlib
2022-05-09 18:06:17 -07:00
swift-ci
5c73c3ca0a
Merge remote-tracking branch 'origin/main' into rebranch
2022-05-05 19:43:52 -07:00
Alex Martini
b3fc822a17
Clean up Hashable doc changes.
...
- Use present tense instead of future tense.
- Fix subject/object agreement.
- Fix indentation.
Follow-on to 58dd343dff (PR 58652).
2022-05-05 15:22:23 -07:00
swift-ci
032fe5b024
Merge remote-tracking branch 'origin/main' into rebranch
2022-05-04 14:29:49 -07:00
Karoy Lorentey
e285c41df9
[stdlib][docs] Slightly clarify Hashable docs
2022-05-03 16:29:52 -07:00
swift-ci
746f490f80
Merge remote-tracking branch 'origin/main' into rebranch
2022-05-02 07:14:58 -07:00
Erik Eckstein
a2c29858c3
stdlib: annotate the Array semantics functions with escape effects
2022-05-02 12:00:06 +02:00
swift-ci
fcfb12195a
Merge remote-tracking branch 'origin/main' into rebranch
2022-04-29 14:35:21 -07:00
Karoy Lorentey
b8cbd4f226
[stdlib][docs] Clarify BidirectionalCollection requirements
...
As discussed on the forum, `BidirectionalCollection` requirements as
currently stated can be interpreted to forbid conforming types from
accepting indices that lie between valid (i.e., reachable) indices
in the collection. Among other undesirable effects, this
interpretation would render SE-0180 (String.Index overhaul)
incompatible with these requirements.
Update the wording to clarify that the requirements only apply to
valid indices. (Collection protocols do not constrain the behavior of
invalid indices — it’s up to individual collection types to implement
them as they wish.)
https://forums.swift.org/t/string-index-unification-vs-bidirectionalcollection-requirements/55946
rdar://92297280
2022-04-25 15:18:35 -07:00
swift_jenkins
3e55915bcb
Merge remote-tracking branch 'origin/main' into next
2022-04-24 15:21:10 -07:00
Saleem Abdulrasool
5c0471fb48
stdlib: correct CLong for Windows ARM64
...
The Windows ARM64 build with the toolchain fixes exposed the missed type
aliasing for `CLong` when building Foundation. With this it is finally
possible to build a complete SDK for Windows AArch64.
2022-04-24 10:33:36 -07:00
swift_jenkins
ee2fb0bc35
Merge remote-tracking branch 'origin/main' into next
2022-04-22 12:33:42 -07:00
swift-ci
c997944270
Merge pull request #42128 from amartini51/sendable_docs_87221356
...
Add reference page for Sendable protocol.
2022-04-22 12:05:59 -07:00
swift_jenkins
de7ecec04e
Merge remote-tracking branch 'origin/main' into next
2022-04-21 19:22:23 -07:00
Jager-yoo
b3de1f3e25
Fix mismatched constant name in static func == doc
...
- I've found a mismatched constant name in `static func ==` example.
- Given the context, it should be `numberToMatch`, not `numberToFind`.
2022-04-21 19:11:17 +09:00
Alex Martini
59e951ae9c
Fix minor wording issues per review feedback
...
Co-authored-by: Brian Lanier <blanier@apple.com >
2022-04-20 15:53:50 -07:00
swift_jenkins
a461eb25da
Merge remote-tracking branch 'origin/main' into next
2022-04-19 21:21:22 -07:00
swift-ci
4184a0bb57
Merge pull request #42096 from kateinoigakukun/pr-24e8c53c23a06f91bc290068f3209e095a88bdcf
...
[Wasm][KeyPath] Resolve absolute function pointer as identity
2022-04-19 21:08:45 -07:00
swift_jenkins
da01d52532
Merge remote-tracking branch 'origin/main' into next
2022-04-19 20:41:22 -07:00
Karoy Lorentey
2574d78d40
Merge pull request #42442 from lorentey/better-index-conversions
2022-04-19 20:22:06 -07:00
swift_jenkins
093c99483d
Merge remote-tracking branch 'origin/main' into next
2022-04-19 15:08:08 -07:00
Josh Soref
644c18ca9b
Spelling stdlib ( #42444 )
...
* spelling: against
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: algorithmic
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: alignment
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: anything
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: architectural
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: architecture
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: are
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: artificial
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: aside
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: available
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: being
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: bidirectional
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: characters
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: circular
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: compatibility
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: compiled
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: correctly
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: covers
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: declaration
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: dependencies
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: descriptor
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: dictionaries
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: dynamic
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: greater
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: hierarchy
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: immortal
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: initialize
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: initializes
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: iterable
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: message
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: minimum
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: multiple
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: originally
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: simplified
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: sophisticated
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: trivia
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: wasn't
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com >
2022-04-19 14:02:43 -07:00
Josh Soref
a0d2cabda6
Spelling stdlib/public/core ( #42441 )
...
* spelling: available
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: components
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: conjunction
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: conversion
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: enforce
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: guarantee
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: interchangeable
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: satisfied
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: superfluous
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com >
2022-04-19 14:02:24 -07:00
Karoy Lorentey
3eed5347c7
[stdlib] Update comments
2022-04-19 14:02:13 -07:00
Karoy Lorentey
47109ac8d6
[stdlib] Fix thinko
2022-04-19 13:08:43 -07:00
Karoy Lorentey
847337efd7
[stdlib][cosmetics] Clean up unused/underused interfaces, update naming
...
There is little point to having `isUTF16` properties when they simply
return `!isUTF8`; remove them.
Rename `String.Index._copyEncoding(from:)` to
`_copyingEncoding(from:)`.
2022-04-18 21:06:20 -07:00
Karoy Lorentey
5f9828fb88
[stdlib] Don’t reject trailing surrogates in UTF16View overload of String.Index(_:within:)
...
Fix a long-standing issue where the UTF16View overload of
`String.Index.init(_:within:)` used to return nil for valid indices
that happened to point to a trailing surrogate in a UTF-8-encoded
string.
rdar://91935537
2022-04-18 21:03:44 -07:00
Karoy Lorentey
4d557b0b45
[stdlib] Make String.Index(_:within:) initializers more permissive
...
In Swift 5.6 and below, (broken) code that acquired indices from a
UTF-16-encoded string bridged from Cocoa and kept using them after a
`makeContiguousUTF8` call (or other mutation) may have appeared to be
working correctly as long as the string was ASCII.
Since https://github.com/apple/swift/pull/41417 , the
`String(_:within:)` initializers recognize miscoded indices and reject
them by returning nil. This is technically correct, but it
unfortunately may be a binary compatibility issue, as these used to
return non-nil in previous versions.
Mitigate this issue by accepting UTF-16 indices on a UTF-8 string,
transcoding their offset as needed. (Attempting to use an UTF-8 index
on a UTF-16 string is still rejected — we do not implicitly convert
strings in that direction.)
rdar://89369680
2022-04-18 21:02:14 -07:00
swift_jenkins
1652576a53
Merge remote-tracking branch 'origin/main' into next
2022-04-18 15:40:24 -07:00
swift-ci
58c8e2ecd8
Merge pull request #41033 from glessard/se-unaligned
...
[SE-0349] Implementation for unaligned loads from raw memory
2022-04-18 15:29:52 -07:00
Guillaume Lessard
a368e59564
[stdlib] incorporate proposal number in silgen name
2022-04-18 12:50:19 -06:00
Guillaume Lessard
3229902990
[stdlib] state clearly the precondition of loadUnaligned
2022-04-14 17:23:53 -06:00
Guillaume Lessard
1828aca9f0
[stdlib] update UnsafeMutableRawBufferPointer.storeBytes
...
- preserve previous version for ABI and source stability.
- add new version without alignment restriction.
- add explicit POD type enforcement in new version.
2022-04-14 17:23:53 -06:00