Commit Graph

75 Commits

Author SHA1 Message Date
Nate Cook
f6547cc828 Address feedback from @amartini51. 2019-09-26 13:25:15 -05:00
Nate Cook
06102a9ffa Minor additional revisions 2019-09-11 10:09:55 -05:00
Nate Cook
90f9dd480e Merge branch 'master' into nc_lazyscan_fix 2019-08-22 10:47:47 -05:00
Paul Hudson
06f82a53b5 Replaced the majority of ' : ' with ': '. 2019-07-18 20:46:07 +01:00
Dad @ GeekAndDad
749a9726ef Update example code to compile with Swift 5.0/5.1 (#25995)
* Update example code to compile with Swift 5.0/5.1

Took inspiration from Filter.swift as to modern syntax to use, though didn't convert `private` properties to `internal`.

* simplify example code as requested

Removed private scope on properties to enable synthesized initializers; removed previously added explicit initializers; add necessary parameter label.

* Update stdlib/public/core/LazySequence.swift

remove ill advised usability change

Co-Authored-By: Xiaodi Wu <xiaodi.wu@gmail.com>

* Update stdlib/public/core/LazySequence.swift

Co-Authored-By: Xiaodi Wu <xiaodi.wu@gmail.com>
2019-07-09 07:43:48 -05: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
Nate Cook
ab5846c8a9 Shorten parameter name in doc example. 2019-05-10 03:34:44 +02:00
Nate Cook
3be8321675 [stdlib] Fix the example in LazySequenceProtocol docs.
I'm not sure this code ever worked, but this new version does. Also
includes some style revisions to the surrounding text.
2019-04-25 10:39:24 -05: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
dd2f3b4386 [stdlib] More inalienable auditing (#18925)
* Removing FIXME from methods also marked always/never

* Unavailable/deprecated things don't need inlining

* Trivial implementations

* Enum namespaces

* Unsafe performance of opaque/raw pointer

* Dump doesn't need to be fast

* Error paths shouldn't require inlining

* Consistency with surrounding code

* Lazy performance needs specialization
2018-08-23 18:52:21 -07:00
Ben Cohen
4694310e51 [stdlib] Some minor cleanup (#18130)
* Remove case destructuring to _

* Remove some Iterator.Element

* Which idiot wrote this? Oh.

* Switch NibbleSort to just use default impls... shouldn't change perf
2018-07-21 17:29:57 -07:00
Ben Cohen
c6b41a5ae5 Inlineable: protocol interface only 2018-07-06 12:03:34 -07:00
Slava Pestov
2e5aef9c8d stdlib: Remove redundant @usableFromInline attributes 2018-04-06 00:02:30 -07:00
Slava Pestov
e1f50b2d36 SE-0193: Rename @_inlineable to @inlinable, @_versioned to @usableFromInline 2018-03-30 21:55:30 -07:00
Ben Cohen
9361a6b66f [stdlib] Nest Iterator and Index types for various stdlib types (#13489)
* Nest various top-level Iterator and Index types, and flatten extensions.

* Fix tests from nesting iterator

* Nest Unsafe*BufferPointer.Iterator, extensionify UnsafeBufferPointer

* Degyb LazyCollection

* Nest Flatten iterator and index
2017-12-18 15:27:35 -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
Maxim Moiseev
ee5fb33656 [stdlib] Remove the Grand Renaming artifacts of Swift 3 era 2017-08-28 15:54:11 -07:00
Nate Cook
b7af9bfe83 [stdlib] Remove SeeAlso tags 2017-06-13 11:23:51 -05:00
Ben Cohen
ea2f64cad2 [stdlib] Add Sequence.Element, change ExpressibleByArrayLiteral.Element to ArrayLiteralElement (#8990)
* Give Sequence a top-level Element, constrain Iterator to match

* Remove many instances of Iterator.

* Fixed various hard-coded tests

* XFAIL a few tests that need further investigation

* Change assoc type for arrayLiteralConvertible

* Mop up remaining "better expressed as a where clause" warnings

* Fix UnicodeDecoders prototype test

* Fix UIntBuffer

* Fix hard-coded Element identifier in CSDiag

* Fix up more tests

* Account for flatMap changes
2017-05-14 06:33:25 -07:00
ben-cohen
faba513f9e Constrain Lazy.Elements.Element == Element 2017-05-07 10:18:58 -07:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01: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
Nate Cook
8b39706c3f [stdlib] Documentation revisions
- Various edits
- Standardized complexity formatting
2016-08-12 12:24:36 -05:00
Nate Cook
58fb4ef9c5 [stdlib] Clean up various documentation issues (#3804)
* [stdlib] Clean up some documentation formatting

* [stdlib] Update example code for SE-0103

* [stdlib] Fix UnsafeBufferPointer documentation typo

* [stdlib] Collection documentation cleanup

* [stdlib] Fix String.init?(_:UTF16View) description

* [stdlib] Documentation fixes for SE-0091

* [stdlib] Add param info for String(repeating:count:)
2016-07-28 11:25:38 -07:00
Dave Abrahams
b2bbd4c599 reduce(_ initial:combine:) => reduce(_ initialResult:_ nextPartialResult) 2016-07-19 07:12:59 -06:00
Michael Gottesman
fc37603c5f Revert "Implement SE-0118" 2016-07-18 16:44:58 -07:00
Dave Abrahams
b0044948df reduce(_ initial:combine:) => reduce(_ initialResult:_ nextPartialResult) 2016-07-18 14:30:46 -06:00
Michael Gottesman
40e1991e12 Revert "Name and label changes for closure parameters (for review only) (#2981)"
This reverts commit 18406900ba.
2016-07-15 19:45:26 -07:00
Dave Abrahams
18406900ba Name and label changes for closure parameters (for review only) (#2981)
Implement SE-0118 Name and label changes for closure parameters

[SE-0118](https://github.com/apple/swift-evolution/blob/master/proposals/0118-closure-parameter-names-and-labels.md)
2016-07-15 15:31:48 -07:00
Rintaro Ishizaki
6ef62f3c73 [stdlib] Better diagnosis for unavailable APIs
Added tests for expected-error and fix-its.

- Add arguments signature regardless that is the same as before.
  Because the error message looks more natural.
  e.g. "makeIterator" => "makeIterator()",
  "replaceSubrange" => "replaceSubrange(_:with:)"
- Any${ExistentialCollection}.underestimateCount() was a method, not
  computed property.
- 'LazySequenceType' has been renamed to 'LazySequenceProtocol', but not
  'LazyCollectionProtocol'
- Streamable.writeTo(_:) had no argument label.
- Fixed typo in print() debugPrint() error message (not working for now)
- Repeated.init(): changed `renamed` to `message` because the arugment
  order has changed.
- Marked `public` for some unavailable method on `Sequence`
- Sequence.split(_:maxSplit:allowEmptySlices) was replaced with
  split(separator:maxSplits:omittingEmptySubsequences:),
  not split(separator:omittingEmptySubsequences:isSeparator:)
- Sequence.split(_:allowEmptySlices:isSeparator) was replaced with
  split(maxSplits:omittingEmptySubsequences:isSeparator:),
  not split(_:omittingEmptySubsequences:isSeparator:)
- Sequence.startsWith(_:isEquivalent:) or startsWith(_:) had no label on
  the first argument.
- transcode(_:_:_:_:stopOnError), not transcode(_:_:_:_:stoppingOnError)
- Removed mutating methods from UnsafePointer.
  alloc(_:), dealloc(_:), setter:memory, initialize(_:), destroy(),
  and destroy(_:)
2016-07-01 14:52:09 +09:00
Mark Lacey
e03d334b68 Use Builtin.unreachable() in unavailable functions.
Saves a bit of code size in the standard library by eliminating some
static strings and function calls.

rdar://problem/25767016
2016-05-02 21:30:25 -07:00
Nate Cook
6e274913bf [stdlib] Revise documentation for Array- and Set-related types.
This adds and expands documentation for sequences, collections, and the array
types as well as `Set` and its related protocols.
2016-04-25 12:54:39 -05:00
Chris Lattner
4fd8418ba7 move the stdlib to put noescape and autoclosure on the type, instead of
the parameter.  Progress towards SE-0049.
2016-04-14 23:13:43 -07:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Daniel Duan
276370b599 [stdlib] apply SE-0040 to stdlib 2016-03-11 16:01:41 -08:00
Dmitri Gribenko
f0633ce5a9 stdlib: Sequence.iterator() => .makeIterator() 2016-02-23 13:52:30 -08:00
Dmitri Gribenko
9293c1f5cc stdlib: fix coding style 2016-02-18 22:30:58 -08:00
Max Moiseev
61c837209b Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-04 16:13:39 -08:00
Adriano Ferreira
e6be43090e Adjust space in property/subscript declarations 2016-01-22 22:02:29 -05:00
Adriano Ferreira
e6cbebe6ea Revert "Adjust space in property/subscript declarations"
This reverts commit 47ab2e0e28.
2016-01-22 19:53:01 -05:00
Adriano Ferreira
47ab2e0e28 Adjust space in property/subscript declarations 2016-01-22 17:03:15 -05:00
Dmitri Gribenko
574052f1be stdlib: standardize fatalError() messages for unavailable APIs 2016-01-21 16:34:54 -08:00
Max Moiseev
86680ec622 [stdlib] @available attributes for removed APIs 2016-01-20 13:08:27 -08:00
Doug Gregor
7d70b704e4 Merge commit '5e11e3f7287427d386636a169c4065c0373931a8' into swift-3-api-guidelines 2016-01-19 23:18:20 -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
ken0nek
e7e70cea92 Add spaces before and after closure arrow in stdlib 2015-12-23 04:52:15 +09:00
Maxim Moiseev
9e50505970 internal or public // @testable initializers 2015-12-17 17:02:49 -08:00