Ben Cohen
4ddac3fbbd
[stdlib] Eradicate IndexDistance associated type ( #12641 )
...
* Eradicate IndexDistance associated type, replacing with Int everywhere
* Consistently use Int for ExistentialCollection’s IndexDistance type.
* Fix test for IndexDistance removal
* Remove a handful of no-longer-needed explicit types
* Add compatibility shims for non-Int index distances
* Test compatibility shim
* Move IndexDistance typealias into the Collection protocol
2017-12-08 12:00:23 -08:00
Max Moiseev
a24998a5b1
[stdlib] Add missing @_fixed_layout attributes to fix resilience build
2017-10-02 15:19:06 -07:00
Max Moiseev
53b8419279
[stdlib] Make all the stdlib APIs @_inlineable
...
This change in theory should allow us to remove a special stdlib-only
sil-serialize-all compilation mode.
<rdar://problem/34138683>
2017-09-29 11:26:56 -07:00
swift-ci
79a3f9c415
Merge pull request #11670 from natecook1000/nc-rev-77-2
2017-09-19 10:15:59 -07:00
Michael Ilseman
29d0d142bb
[stdlib] Better message for unavailable String.init(_:UTF8Buffer)
2017-09-11 17:14:32 -07:00
Maxim Moiseev
6c7d93491f
Merge pull request #11627 from moiseev/swift-2-artifacts
...
[stdlib] Remove the Grand Renaming artifacts of Swift 3 era
2017-09-05 11:41:18 -07:00
Kuba (Brecka) Mracek
d03a575279
Unify the capitalization across all user-visible error messages ( #11599 )
...
* Unify the capitalization across all user-visible error messages (fatal errors, assertion failures, precondition failures) produced by the runtime, standard library and the compiler.
* Update some more tests to the new expectations.
2017-08-29 12:16:04 -07:00
Nate Cook
050268d876
[stdlib] Documentation revisions
...
- Update NSRange -> Range guidance
- Fix example in Optional
- Improve RangeExpression docs
- Fix issue in UnsafeRawBufferPointer.initializeMemory
- Code point -> scalar value most places
- Reposition the dot above the scripty `i'
- Fix ExpressibleByArrayLiteral code sample
2017-08-29 09:41:55 -05:00
Maxim Moiseev
ee5fb33656
[stdlib] Remove the Grand Renaming artifacts of Swift 3 era
2017-08-28 15:54:11 -07:00
Michael Ilseman
70b836baab
Merge pull request #10971 from an0/master
...
Fix String.UTF8View.Index's conversion init
2017-08-14 14:59:32 -07:00
Nate Cook
a7ce287a53
Merge branch 'master' into integers-revised
2017-07-28 12:23:48 -05:00
Dave Abrahams
41c53ae729
[stdlib] Give Substring its own views
...
This necessary for ensuring the property that String doesn't keep
inaccessible memory alive. For example, before this change,
String(s.dropFirst().unicodeScalars)
would compile and produce a String that owned inaccessible memory.
Now it no longer compiles.
String's view's SubSequences are the same as the Substring's
view. E.g. String.UnicodeScalarView.SubSequence is
Substring.UnicodeScalarView.
New compatibility inits added, to work around the fact that many
previously failable initializers are now non-failable.
2017-07-26 15:59:51 -07:00
Michael Ilseman
442029607b
[stdlib] Add in sanity checks for out-of-bounds legacyOffsets.
...
UTF8View's endIndex needs to potentially apply a legacyOffset. This
adds a sanity check that it is in range, and a fast-path for the
common case of 0.
2017-07-26 15:58:04 -07:00
Maxim Moiseev
a5ff35cd41
[stdlib] extendingOrTruncating: => truncatingIfNeeded:
2017-07-26 11:09:36 -07:00
swift-ci
92898618cb
Merge pull request #10982 from apple/stdlib-swift4-modernization
2017-07-20 18:56:23 -07:00
Dave Abrahams
05ff40d125
[stdlib] Backward-compatible String.UTF8View slicing
...
When slicing String.UTF8View in Swift 3 mode, in the absence of type
context, produce String.UTF8View.
2017-07-20 14:54:16 -07:00
Dave Abrahams
e6519fbd2b
[stdlib] Make String.UTF8View bidirectional
...
This is a step along the way toward handling backward-compatiblity of UTF8View
slicing and preventing inadvertent creation of String instances that keep
inaccessible memory alive.
2017-07-17 13:53:45 -07:00
Ling Wang
c781dc1598
Fix code formatting issues
2017-07-15 12:32:33 -05:00
Dave Abrahams
c497969987
[stdlib] Swift4 Modernizations Compatible with Swift 3.2
2017-07-14 17:54:33 -07:00
Ling Wang
6bbb96b97d
String.UTF8View.Index's conversion init should check whether sourcePosition is already a utf8 index first. Otherwise it may return nil for a valid utf8 sourcePosition.
2017-07-14 14:27:41 -05:00
Dave Abrahams
9159239995
Un-revert "[stdlib] String index interchange, etc." ( #10812 )
...
I failed to merge the upstream changes to swift-corelibs-foundation at the same
time as I merged that #9806 , and it broke on linux. Going to get it right this
time.
2017-07-07 12:13:25 -07:00
Xi Ge
d9fb110674
Revert "[stdlib] String index interchange, etc." ( #10812 )
...
rdar://33186295
2017-07-07 12:03:16 -07:00
Dave Abrahams
283775ed1f
[stdlib] Rebuild String.Index for UTF8View
2017-07-07 06:15:26 -07:00
Dave Abrahams
576b8de64a
[stdlib] Speed String.UTF8View.count even more
2017-07-07 06:15:26 -07:00
Dave Abrahams
cf09e6b383
[stdlib] UTF8View: count by iterating
...
The fancy code didn't turn out to be any faster.
2017-07-07 06:15:26 -07:00
Dave Abrahams
dd3fb9b71d
[stdlib] Small correction to UTF8 Iterator
...
This works either way I suppose, but the code is clearer now.
2017-07-07 06:15:25 -07:00
Dave Abrahams
b21fa4575a
[stdlib] UTF8View Iterator and count specialization
2017-07-07 06:15:25 -07:00
Dave Abrahams
b1d2f4c68e
[stdlib] String index interchange, part III (UTF8)
2017-07-07 06:15:24 -07:00
Dave Abrahams
2e0bb2f533
[stdlib] String index interchange, part II (UTF16)
2017-07-07 06:15:23 -07:00
Dave Abrahams
e523c80339
[stdlib] Index interchange, part I
2017-07-07 00:59:04 -07:00
Dave Abrahams
d6fee05375
[stdlib] Enable interchange among StringProtocol models
2017-05-17 17:21:43 -07:00
Nate Cook
f650e0a7da
[stdlib] String and range expressions
...
* finish string documentation revisions
* revise examples throughout to use range expressions instead of e.g.
prefix(upTo: _)
2017-05-13 10:06:12 -05:00
Dave Abrahams
ddf7ad517f
UnicodeScalar => Unicode.Scalar
2017-05-11 15:23:25 -07:00
Dave Abrahams
4e878a28b6
[stdlib] Inline _encodeSomeUTF8
2017-05-02 18:10:57 -07:00
Max Moiseev
7b98267d78
Fixing the unicode tests by removing the potential optimization
2017-04-14 17:03:26 -07:00
Max Moiseev
cd98994b9d
Improving the performance of String.UTF8View
2017-03-30 10:22:30 -07:00
Max Moiseev
27889c6376
Merge remote-tracking branch 'origin/master' into new-integer-protocols
2017-01-06 15:54:44 -08:00
practicalswift
6d1ae2a39c
[gardening] 2016 → 2017
2017-01-06 16:41:22 +01:00
Max Moiseev
d7e92a5bc5
Using masking shifts
2016-12-15 14:53:56 -08:00
Max Moiseev
61b923f396
Using init(extendingOrTruncating:) instead of a deprecated init(truncatingBitPattern:)
2016-12-15 14:53:31 -08:00
Max Moiseev
70b2343626
Merge branch 'master' into new-integer-protocols
2016-11-28 15:25:01 -08:00
practicalswift
797b80765f
[gardening] Use the correct base URL ( https://swift.org ) in references to the Swift website
...
Remove all references to the old non-TLS enabled base URL (http://swift.org )
2016-11-20 17:36:03 +01:00
Max Moiseev
8fea72db20
Using more masking shifts
2016-11-16 14:45:32 -08:00
airspeedswift
ed5231b47c
Numbered all FIXME(ABI) entries for tracking purposes. ( #4868 )
2016-09-19 16:41:41 -07:00
Dmitri Gribenko
77813904f8
stdlib: replace error-prone pairs of isASCII/startASCII calls with an API that returns Optional
2016-09-05 22:47:24 -07:00
Nicholas Maccharoli
2f1e5361df
[stdlib] simplify repeat to while
2016-08-25 18:54:42 +09:00
Michael Ilseman
b7c9eddd11
[noescape by default] drop @noescape from stdlib
2016-08-04 16:09:01 -07:00
Rintaro Ishizaki
091506315b
[SE-0101] Implement: Reconfiguring sizeof and related functions into MemoryLayout struct
...
As of now:
* old APIs are just marked as `deprecated` not `unavaiable`. To make it
easier to co-operate with other toolchain repos.
* Value variant of API is implemented as public @private
`_ofInstance(_:)`.
2016-07-30 03:09:28 +09:00
Robert Widmann
4c2dbe1723
[stdlib][SE-0089] Finish off Lossless String Conversion ( #3761 )
...
* Rename string reflection init
* Addressing PR comments and updating some tests
* Update test suite for lossless string conversion
2016-07-28 17:13:25 -07:00
Xiaodi Wu
b04830ffc7
[SE-0134] Address reviewer comments
2016-07-27 22:43:16 -05:00