Commit Graph

600 Commits

Author SHA1 Message Date
Saleem Abdulrasool b67d5f0cf7 test: convert rm -rf && mkdir -p into %empty-directory
This converts the instances of the pattern for which we have a proper
substitution in lit.  This will make it easier to replace it
appropriately with Windows equivalents.
2018-03-06 14:30:54 -08:00
Nate Cook 3543625a41 [test] Update prototypes to use conditional conformance (#14274) 2018-02-01 18:30:00 +01:00
Ben Cohen ca6c6b1d36 [stdlib] Cleanup DefaultIndices, delete dead code (#13952)
* Remove a bunch of Default(Bidirectional|RandomAccess)Indices usage from stdlib and test

* Remove some DefaultRandomAccessIndices and IndexDistance usage from Foundation

* Remove no-longer-used internal type in Existentials.swift

* Get rid of indicesForTraversal
2018-01-15 13:48:08 -08:00
swift-ci adf83617ec Merge pull request #13526 from DougGregor/remove-conditional-conformances-flag 2017-12-19 11:17:44 -08:00
Doug Gregor ffb0d55b35 Eliminate extraneous uses of -enable-experimental-conditional-conformances 2017-12-18 22:56:22 -08: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
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
Ben Cohen 85d190cd7d [stdlib] Replace various uses of BlahSlice with Slice to reduce warnings (#13263)
* Kill the slice variants from the gybbed collection test types

* Handful more SDK instances

* Fix SequencesCollections.swift.gyb
2017-12-05 19:09:56 -08:00
Ben Cohen dcab9493ae Removed some warnings (#12753) 2017-11-30 15:12:56 -08:00
Ben Cohen c4f0b5fe94 [stdlib] Adopt conditional conformance for Indices, Slice, ReversedCollection (#12913)
* Refactor Indices and Slice to use conditional conformance

* Replace ReversedRandomAccessCollection with a conditional extension

* Refactor some types into struct+extensions

* Revise Slice documentation

* Fix test cases for adoption of conditional conformances.

* [RangeReplaceableCollection] Eliminate unnecessary slicing subscript operator.

* Add -enable-experimental-conditional-conformances to test.

* Gruesome workaround for crasher in MutableSlice tests
2017-11-30 09:10:22 -08:00
Kuba (Brecka) Mracek 3e87cf4bd1 Remove "%T" expansions (#11612) 2017-11-28 15:47:14 -08:00
taylor swift c85880899d implement SE 184: add allocation methods to Unsafe buffer pointers, drop all parameters from deallocation, adjust namings, and add repeated-value assignment methods 2017-11-17 21:28:03 -08:00
Nate Cook 6d09c7a91f [stdlib] Remove *Subrange methods from algorithms prototype
Now that slices pin properly, the recursive parts of these algorithms
can operate on collection slices instead of the whole collection with
a `subrange` parameter. Adds tests to make sure we’re successfully
performing the operation without reallocations.

* Fix exclusive access warnings for Algorithms prototype
* Modernize generic constraints and range expressions
* Remove _Subrange methods in Algorithms prototype
* Add slice conformances to MutableCollectionAlgorithms
* Re-indent partitionPoint with 2 spaces
* Add documentation for internal algorithms
* Switch algorithms prototype to use Swift 4.0
2017-10-09 09:28:30 -05:00
Dave Abrahams 9d78fb6d37 Pattern matching prototype: expunge Element_ hack 2017-08-31 11:02:58 -07:00
Dave Abrahams fcb2797d60 Strip obsolete workaround 2017-08-29 15:30:57 -07:00
Dave Abrahams b14d586579 Strip obsolete constraints 2017-08-29 15:16:59 -07:00
Joe Shajrawi 66d0df6bae Revert "Temporary disable failing armv7 tests"
This reverts commit 78e5e25215.
2017-08-15 13:43:57 -07:00
Joe Shajrawi 78e5e25215 Temporary disable failing armv7 tests 2017-08-08 15:22:14 -07:00
Nate Cook a7ce287a53 Merge branch 'master' into integers-revised 2017-07-28 12:23:48 -05:00
Max Moiseev 1c3e597928 [stdlib] Get rid of ArithmeticOverflow type 2017-07-26 11:09:36 -07:00
Maxim Moiseev 5d47a0d98d [stdlib] init<T : FloatingPoint> ==> init<T : BinaryFloatingPoint> 2017-07-26 11:09:36 -07:00
Maxim Moiseev a5ff35cd41 [stdlib] extendingOrTruncating: => truncatingIfNeeded: 2017-07-26 11:09:36 -07:00
Dave Abrahams 33e9ec4690 [stdlib] Rationalize bitshifting in protocols
Only FixedWidthInteger, not BinaryInteger, should have masking shifts.
BinaryInteger should have a non-masking shift requirement.

Removed some dead code.
2017-07-18 16:00:44 -07:00
Károly Lőrentey 46dc04fc01 BigInt prototype: Reserve capacity for words. Add some tests. 2017-07-11 03:10:26 +02:00
Károly Lőrentey 0246ef187d BigInt prototype: Fix Bit.leadingZero/trailingZero 2017-07-11 03:08:43 +02:00
Károly Lőrentey c8d4fd4242 [stdlib] Remove BinaryInteger._word(at:)
Removes BinaryInteger's _word(at:) requirement and its
countOfRepresentedWords property, making the words property the
sole way to access an integer's words.

This is a better fix for https://bugs.swift.org/browse/SR-5275.
2017-07-10 22:40:52 +02:00
Károly Lőrentey 7836268d45 [stdlib] Implement BinaryInteger.words in standard integer types.
Introduces the following new collection types as lightweight
views of a corresponding integer value:

- UInt.Words
- UInt64.Words (on 32-bit platforms)
- DoubleWidth.Words

The rest of the standard integer types define Words as a typealias
to one of the first two of these, based on their width.
2017-07-10 19:03:34 +02:00
Xiaodi Wu 93e76cdc83 Update BigInt.swift 2017-06-21 20:05:09 -05:00
Dmitri Gribenko 984210aa53 tests: replace '// RUN: rm -rf' '// RUN: mkdir' pairs with '%empty-directory(...)'
These changes were made using a script.
2017-06-04 11:08:39 -07:00
Dmitri Gribenko 486cab447d tests: replace 'rm -rf %t && mkdir -p %t' with '%empty-directory(%t)'
These changes were made using a script.
2017-06-04 11:08:39 -07:00
Dave Abrahams db8045d865 [stdlib] Strip _Element from a Swift4-only test
Missed this one the first time around
2017-05-22 23:17:50 -07:00
Slava Pestov d63bf4ee41 Sema: Fix for bogus ParenType showing up in deduced associated types
When matching inputs of a function type, be sure to
strip off ParenType sugar so that we don't end up
with ParenTypes in associated type witnesses.

This fixes various issues with SE-0110.

Fixes <rdar://problem/32214649>.
2017-05-17 00:39:46 -07: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
Dave Abrahams 41c244a065 [stdlib] Unicode[Encoding|Parser] => Unicode.[Encoding|Parser] 2017-05-11 17:21:39 -07:00
Dave Abrahams ddf7ad517f UnicodeScalar => Unicode.Scalar 2017-05-11 15:23:25 -07:00
Dave Abrahams 97f875ad84 [stdlib] De-underscore Unicode "namespace" 2017-05-11 15:23:25 -07:00
Dave Abrahams c64534a873 [stdlib] API adjustments in preparation for proposal update 2017-05-09 11:19:24 -07:00
Dave Abrahams e7b32f9dc9 [stdlib] UnicodeEncoding: hide/internalize APIs we're not sure about
The best high-level APIs for decoding/transcoding are still under active
investigation.  It's likely we want more views.  Therefore, leave
de-underscored/public only the lowest-level APIs for now.
2017-05-09 10:20:29 -07:00
Dave Abrahams fd8cfea3ac [stdlib] String initialization with encoding and CString interop 2017-05-08 19:50:38 -07:00
Dave Abrahams c5d6880053 [stdlib] Add ASCII UnicodeEncoding, drop uses of legacy codecs
Preparation for new C-string interop.
2017-05-07 20:43:44 -07:00
Dave Abrahams f4610e1638 [stdlib] encode/transcode => [encode/transcode]IfRepresentable...
...to make room for a more useful encode/transcode that inject replacement
characters when encoding fails.
2017-05-07 20:43:44 -07:00
Dave Abrahams e08fd9af46 [stdlib] Direct unicode transcoding
without passing through decoded UnicodeScalars.
2017-05-06 16:58:08 -07:00
Dave Abrahams 796d004fd0 [stdlib] Allow Unicode Encoding to fail
This is needed for encodings such as Latin-1
2017-05-06 16:53:35 -07:00
Dave Abrahams feea061d32 [stdlib] Move new Unicode decoders into the stdlib
No expected change in benchmarks, as legacy components aren't using this yet.
2017-05-01 17:08:08 -07:00
Dave Abrahams cda4579894 [stdlib] UnicodeDecoders: add encode requirement 2017-05-01 03:54:24 -07:00
Dave Abrahams 9af9cffcde [stdlib] UnicodeDecoders: comments 2017-05-01 02:45:50 -07:00
Dave Abrahams 36707992e7 [stdlib] UnicodeDecoders: Decoder => Parser, access control...
...to the extent possible anyway.  Underscoring for the rest.
2017-05-01 02:41:15 -07:00
Dave Abrahams 22aa340fd4 Fix a typo 2017-05-01 02:32:22 -07:00
Dave Abrahams c6883cbe34 [stdlib] UnicodeDecoders: add _UTFEncoding and sink _isScalar there 2017-05-01 02:07:59 -07:00
Dave Abrahams 2ace06e178 80-column cleanups 2017-05-01 01:39:34 -07:00