Commit Graph

76 Commits

Author SHA1 Message Date
Anthony Latsis
c731089068 Gardening: Migrate stdlib sources to GH issues 2022-09-26 06:30:49 +03:00
Karoy Lorentey
7a7ebd8970 [stdlib] Adopt primary associated types in the stdlib 2022-05-09 18:06:17 -07:00
Xiaodi Wu
3927e78f64 Add to-do for Stride* implementation of _customContainsEquatableElement (#39908) 2021-10-25 21:00:06 -04:00
Xiaodi Wu
fa4d08ab9f Fix _customContainsEquatableElement implementation for Stride* types (#39903)
* Fix `_customContainsEquatableElement` implementation for `Stride*` types

* Add tests for `Stride*.contains`
2021-10-25 14:07:01 -04:00
Kuba (Brecka) Mracek
404badb49a Introduce SWIFT_ENABLE_REFLECTION to turn on/off the support for Mirrors and reflection (#33617) 2021-09-08 13:08:13 -07:00
Doug Gregor
9579390024 [SE-0304] Rename ConcurrentValue to Sendable 2021-03-18 22:48:20 -07:00
Xiaodi Wu
4c7059f59a [stdlib][SR-13883] Avoid advancing past representable bounds when striding (#34860)
* [stdlib][SR-13883] Avoid advancing past representable bounds when striding.

* [stdlib] Expand a test and add a comment to ensure correct floating-point stride bounds checking.

* [stdlib][NFC] Clarify a comment in a test.

* [stdlib][NFC] Adjust copyright notices, clarify comments, delete '-swift-version=3' for tests.

* [stdlib] Add implementations for fixed-width integer strides for performance.

* [stdlib] Document `Strideable._step` and modify overflow checking behavior of `Stride*Iterator`.

* [stdlib] Address reviewer comments, postpone documentation changes

* [stdlib][NFC] Update documentation for '_step(after:from:by:)'

* [stdlib][NFC] Use 'nil' instead of an arbitrary value for integer striding '_step' index
2021-03-11 08:18:28 -05:00
Doug Gregor
1a1f79c0de Introduce safety checkin for ConcurrentValue conformance.
Introduce checking of ConcurrentValue conformances:
- For structs, check that each stored property conforms to ConcurrentValue
- For enums, check that each associated value conforms to ConcurrentValue
- For classes, check that each stored property is immutable and conforms
  to ConcurrentValue

Because all of the stored properties / associated values need to be
visible for this check to work, limit ConcurrentValue conformances to
be in the same source file as the type definition.

This checking can be disabled by conforming to a new marker protocol,
UnsafeConcurrentValue, that refines ConcurrentValue.
UnsafeConcurrentValue otherwise his no specific meaning. This allows
both "I know what I'm doing" for types that manage concurrent access
themselves as well as enabling retroactive conformance, both of which
are fundamentally unsafe but also quite necessary.

The bulk of this change ended up being to the standard library, because
all conformances of standard library types to the ConcurrentValue
protocol needed to be sunk down into the standard library so they
would benefit from the checking above. There were numerous little
mistakes in the initial pass through the stsandard library types that
have now been corrected.
2021-02-04 03:45:09 -08:00
Paul Hudson
06f82a53b5 Replaced the majority of ' : ' with ': '. 2019-07-18 20:46:07 +01:00
Ben Cohen
e9d4687e31 De-underscore @frozen, apply it to structs (#24185)
* De-underscore @frozen for enums

* Add @frozen for structs, deprecate @_fixed_layout for them

* Switch usage from _fixed_layout to frozen
2019-05-30 17:55:37 -07:00
Ben Cohen
df2307e035 [stdlib][DNM] Collapse sequence and collection wrappers (#20221)
* Concretize dropFirst/Last/sufix/prefix from Sequence

Remove split customization point

Eliminate SubSequence from Sequence protocol

Collapse LazyCollection

Collapse LazyMapCollection

Eliminate _SequenceWrapper

Collapse LazyFilterCollection

Collapse LazyDrop/PrefixWhileCollection

Fix tests, ABI stability update

Collapse FlattenSequence

* Add entries to source/ABI compatible expected results.

* Update tests to avoid pre-10.14 objc runtime bug

* Expunge _preprocessingPass
2018-11-14 10:05:58 -08:00
Ben Cohen
ae6f5dd604 [stdlib] Add consuming/owned annotations to Collection implementations (#19360)
* Add consuming/owned annotations to Collection implementations

* Update SILOptimizer tests

* Fix access_marker_verify test

* XFAIL reconstruct_type_from_mangled_name
2018-09-21 12:06:56 -07:00
Ben Cohen
48e298a589 [stdlib] Remove vestigial _DisabledRangeIndex associated type (#18419)
* Remove vestigial _DisabledRangeIndex associated type

* Remove _DisabledRangeIndex from Integer types
2018-08-10 17:34:43 -06:00
Ben Cohen
57528ef458 De-gyb Stride.swift (#17956) 2018-07-16 16:02:22 -07:00
Nate Cook
fde926122e Duplicate _Strideable declarations in Strideable
This will make advanced(by:) and distance(to:) visible as
members of Strideable.
2016-04-04 20:11:16 -05:00
Dave Abrahams
3b41409bb6 [stdlib] indexing model: Range indexing diagnostics 2016-03-22 09:22:58 -07:00
Dave Abrahams
c5031aacf2 [stdlib] indexing model: Overload bug workarounds
rdar://25214598
2016-03-17 14:45:15 -07:00
Dmitri Gribenko
3cde854287 Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-03-12 01:11:32 -08:00
Dmitri Gribenko
b2a22d8c7d stdlib: improve a FIXME in Stride.swift 2016-03-11 18:06:13 -08:00
Daniel Duan
276370b599 [stdlib] apply SE-0040 to stdlib 2016-03-11 16:01:41 -08:00
Max Moiseev
a49dab6bf8 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-29 12:08:52 -08:00
Daniel Duan
2bc78b8c09 [stdlib] update for 'inout' adjustment (SE-0031) 2016-02-26 12:02:29 -08:00
Max Moiseev
0490e86d01 [stdlib] strideTo/strideThrough => stride(to:...)/stride(through:...) 2016-02-24 09:56:10 -08:00
Dmitri Gribenko
f0633ce5a9 stdlib: Sequence.iterator() => .makeIterator() 2016-02-23 13:52:30 -08:00
Max Moiseev
40b1a0b7e0 [stdlib] all sorts of require renamed back to precondition 2016-02-19 18:21:29 -08:00
Dmitri Gribenko
dd75aed67a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-17 14:40:05 -08:00
Dmitri Gribenko
efaa39ea79 stdlib: add first argument labels and some other changes to conform to API guidelines 2016-02-15 23:47:54 -08:00
Nate Cook
51251dc133 Convert imperative function summaries to present.
i.e., "Return ..." -> "Returns ..."
2016-02-12 04:20:39 -06:00
Nate Cook
f3c4e0ac74 Remove style on *generator* and friends. 2016-02-12 04:20:01 -06:00
Max Moiseev
61c837209b Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-04 16:13:39 -08:00
Austin Zheng
77918a86ac [SR-88] Reinstate Mirror migration changes, fix test issues
This reverts commit 182bb7f812.
2016-01-27 20:40:52 -08:00
Andrew Trick
182bb7f812 Revert "Merge pull request #1058 from austinzheng/az-port-mirror"
This pull request broke the following tests on several build configurations
(eg --preset=buildbot,tools=RA,stdlib=DA)

    1_stdlib/Reflection.swift
    1_stdlib/ReflectionHashing.swift
    1_stdlib/UnsafePointer.swift.gyb

This reverts commit c223a3bf06, reversing
changes made to 5c2bb09b09.
2016-01-27 10:43:08 -08:00
Austin Zheng
10d5b23c30 [SR-88] Reinstate mirror migration commit
Changes:
- Reverted commit reverting original SR-88 commit
- Removed mirror children helper collections and related code
- Rewrote some tests to keep them working properly
- Wrote two more tests for the three pointer APIs to ensure no crashes if created using a value > Int64.max

This reverts commit 8917eb0e5a.
2016-01-26 19:28:32 -08:00
Mark Lacey
8917eb0e5a Revert "[Runtime][StdLib] Migrate mirrors to use CustomReflectable API, rewrite dump()"
This reverts commit 9798dfd4aa because it
broke the stdlib build.
2016-01-22 08:41:07 -08:00
Austin Zheng
9798dfd4aa [Runtime][StdLib] Migrate mirrors to use CustomReflectable API, rewrite dump()
Jira: SR-88
Changes:
- Removed stdlib type conformances to _Reflectable
- Conformed stdlib types to CustomReflectable, CustomPlaygroundQuickLookable
- Rewrote dump() function to not use _reflect()
- CGRect, CGPoint, CGSize now conform to CustomDebugStringConvertible
- Rewrote unit tests for compatibility with new API
2016-01-21 09:44:15 -08:00
Doug Gregor
7d70b704e4 Merge commit '5e11e3f7287427d386636a169c4065c0373931a8' into swift-3-api-guidelines 2016-01-19 23:18:20 -08:00
Dmitri Gribenko
74ce1ca79c Add unavailable declarations for Swift 2.2 -> 3 migration 2016-01-19 14:32:59 -08:00
gregomni
e2dee6b9dd [stdlib] Switch keywords from 'typealias' to 'associatedtype' in stdlib
Fixes deprecation warnings arising from addition of new
‘associatedtype’ keyword in sr-511.
2016-01-14 09:39:15 -08:00
Max Moiseev
f51e708a8f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-04 12:25:25 -08:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Chris Lattner
12e670a5b7 Merge pull request #464 from nielsandriesse/patch-6
Make local variable name more expressive
2015-12-25 16:07:10 -08:00
Dmitri Gribenko
5498aa1938 stride(to:by:) => strideTo(_:by:)
and `stride(through:by:)` => `strideThrough(_:by:)`
2015-12-18 16:20:01 -08:00
Dmitri Gribenko
9d4d9e8d41 Fix coding style in Stride.swift 2015-12-17 17:06:41 -08:00
Maxim Moiseev
9e50505970 internal or public // @testable initializers 2015-12-17 17:02:49 -08:00
Maxim Moiseev
e6468a0eca _precondition => _require 2015-12-16 17:19:01 -08:00
Max Moiseev
806be29941 Merge remote-tracking branch 'origin' into swift-3-api-guidelines 2015-12-14 12:05:35 -08:00
Niels Andriesse
7275aa2c84 Change element to result 2015-12-13 10:16:52 +11:00
Dmitri Gribenko
9359b8a9f7 Merge pull request #465 from nielsandriesse/patch-7
Fix inconsistent indentation
2015-12-12 15:05:25 -08:00
Niels Andriesse
7398a88d2c Fix documentation 2015-12-13 09:44:00 +11:00
Niels Andriesse
a67ef174c0 Fix inconsistent indentation 2015-12-13 09:32:18 +11:00