Commit Graph

4464 Commits

Author SHA1 Message Date
Ben Cohen
cdcbd1b32a Fix incorrect rename 2018-06-21 17:12:00 -07:00
Ben Cohen
2eec236f13 Move two more Iterators into nested types 2018-06-21 16:28:20 -07:00
swift-ci
ce3d5ff1a1 Merge remote-tracking branch 'origin/master' into master-next 2018-06-21 07:29:58 -07:00
Tony Arnold
8b9dd25337 Don’t use an error for flow control in Sequence.first(where:) (#17387) 2018-06-21 07:22:11 -07:00
swift-ci
f636e469b1 Merge remote-tracking branch 'origin/master' into master-next 2018-06-20 17:08:52 -07:00
Stephen Canon
ff89fce7df Make FloatingPoint require that Self.Magnitude == Self (#17323)
* Make FloatingPoint require that Self.Magnitude == Self

We didn't have the where clause to express this constraint at the time that the FloatingPoint protocol was implemented, but we do now. This is not a semantic change to FloatingPoint, which has always bound IEEE-754 arithmetic types, for which this constraint would necessarily hold, but it does effect the type system.

For example, currently the following function does not type check:
~~~~
func foo<T>(x: T) -> T where T: FloatingPoint {
  var r = x.remainder(dividingBy: 1)
  return r.magnitude
}
~~~~
with this change, it compiles correctly.

Having done this, we no longer need to have a separate `abs` defined on FloatingPoint; we can use the existing function defined on `SignedNumeric` instead. Additionally mark the global `fabs` defined in the platform C module deprecated in favor of the Swift `abs`; we don't need to carry two names for this function going forward.
2018-06-20 19:56:22 -04:00
Bob Wilson
ea055fcbdc Merge remote-tracking branch 'origin/master' into master-next 2018-06-19 22:47:54 -07:00
Joe Groff
46cd1b786b stdlib: Make data structure protocols ready for future move-only types.
We would like to eventually extend Array, Dictionary, and Set to support move-only element types when the language does. To that end, we need to get the `consuming`-ness of protocol requirements on Sequence, Collection, and related protocols right for forward compatibility so that a future version of Swift that extends these types to support move-only data structures remains ABI- and API-compatible with older versions of the language. Mark requirements as `__consuming` where it would be necessary for a move-only implementation of one of these types.
2018-06-19 14:23:24 -07:00
swift-ci
293bd1d0cc Merge remote-tracking branch 'origin/master' into master-next 2018-06-19 12:09:50 -07:00
Michael Ilseman
26af64d78c Merge pull request #17292 from ikesyo/remove-string-_core
[String] Remove `_core` which is not used in swift-corelibs-foundation anymore
2018-06-19 12:03:45 -07:00
swift-ci
9b7a0d6542 Merge remote-tracking branch 'origin/master' into master-next 2018-06-18 13:28:59 -07:00
Slava Pestov
88d305cade Merge pull request #17296 from lorentey/usableFromInline-typealiases
[stdlib] Add @usableFromInline to internal typealiases that need it
2018-06-18 13:21:31 -07:00
swift-ci
2a0e83dc0d Merge remote-tracking branch 'origin/master' into master-next 2018-06-18 11:00:19 -07:00
Max Moiseev
c16d9ce746 Merge pull request #17262 from moiseev/characterview-warning
[stdlib] Eliminate some warnings while building the stdlib
2018-06-18 10:48:16 -07:00
Karoy Lorentey
23c630ac92 [stdlib] Add @usableFromInline to internal typealiases that need it
This fixes 3659 warnings in the standard library.
2018-06-18 16:34:19 +01:00
Sho Ikeda
6d95b8f3a2 [String] Remove _core which is not used in swift-corelibs-foundation anymore 2018-06-18 22:03:02 +09:00
Max Moiseev
baaa4a9ac3 Eliminate some warnings while building the stdlib
- Move deprecated declarations into a separate deprecated extension
(suppresses tghe warning)
- Mark an initializer from CharacterView as deprecated

Addresses: <rdar://problem/40625231>
2018-06-15 15:29:47 -07:00
Michael Ilseman
fd1c861415 [string] ASCII/UTF-8 fast paths for String.init(decoding:as:)
Add some fast paths to String.init(decoding:as:) for inputs of
contiguously stored UTF-8 code units. Dramatically speeds up creation
when the String happens to be ASCII and we can form more small
strings.
2018-06-15 14:41:26 -07:00
Bob Wilson
5df3d1f100 Merge remote-tracking branch 'origin/master' into master-next 2018-06-14 20:51:48 -07:00
swift-ci
6dc658ff21 Merge pull request #17109 from natecook1000/nc-fixes-86-1 2018-06-14 18:24:18 -07:00
Nate Cook
653a4d89d2 [stdlib] Revise documentation comments
- Clarify RawValue requirement for OptionSet
- Make Bool counterexample more clearly an error
- Add clarifying note about unsafe arithmetic methods
- Add/refine complexity docs for sequence/collection
- Remove docs from obsoleted symbols
- Standardize on unicode.org for links about Unicode
- More complexity annotations
- Expand dictionary defaulted subscript docs
- Fix error in Dictionary.init(minimumCapacity:) docs
- Improve accuracy of prime number listing
2018-06-14 19:19:19 -05:00
swift-ci
ddb1e72c79 Merge remote-tracking branch 'origin/master' into master-next 2018-06-12 18:29:16 -07:00
swift-ci
875a0d797f Merge pull request #17064 from compnerd/bridge 2018-06-12 18:13:28 -07:00
Bob Wilson
796122fa45 Merge remote-tracking branch 'origin/master' into master-next 2018-06-12 15:06:47 -07:00
Doug Gregor
0f2de235c5 Merge pull request #15917 from DougGregor/evaluator
Introduce a simple request evaluator.
2018-06-12 10:41:08 -07:00
Saleem Abdulrasool
8409d29ca3 stdlib: unify AnyObject downcast
Now that bridging is enabled, unify the ObjC and non-ObjC paths.  Expand
the comment with how to efficiently grab the object reference and when
it can be enabled.
2018-06-12 09:50:54 -07:00
swift-ci
e7b949e94e Merge remote-tracking branch 'origin/master' into master-next 2018-06-09 23:49:27 -07:00
Slava Pestov
4e0e462d23 Rename a few remaining @_inlineable => @inlinable, @_versioned => @usableFromInline 2018-06-09 22:41:54 -07:00
swift-ci
83f5d1b79c Merge remote-tracking branch 'origin/master' into master-next 2018-06-07 16:29:38 -07:00
Erik Eckstein
063e5792b8 stdlib: small improvements for StringObject.
1) don't use stringObjectOr for plain integer bits masks
2) no need to clear the extra bits on initialization.
2018-06-07 13:43:34 -07:00
swift-ci
5dcf36afba Merge remote-tracking branch 'origin/master' into master-next 2018-06-07 11:09:40 -07:00
Dave Abrahams
0c7a091390 Use _halfStablePartition to implement partition and removeAll(where:) 2018-06-07 08:43:08 -07:00
swift-ci
b87ea23124 Merge remote-tracking branch 'origin/master' into master-next 2018-06-06 17:29:44 -07:00
Erik Little
863f3a19ff Rename @effects to @_effects
@effects is too low a level, and not meant for general usage outside
the standard library. Therefore it deserves to be underscored like
other such attributes.
2018-06-06 12:53:03 -04:00
swift-ci
5b16aad7c7 Merge remote-tracking branch 'origin/master' into master-next 2018-06-05 22:28:58 -07:00
Alejandro
f4a81d1368 Remove a warning, some doc fixes (#16863)
usableFromInline -> inlinable

More doc fixes

Add some more inlines
2018-06-06 00:13:14 -05:00
swift-ci
f11b43dd7a Merge remote-tracking branch 'origin/master' into master-next 2018-06-05 15:49:22 -07:00
Huon Wilson
46db3a1ecc Merge pull request #16662 from fredpi/patch-1
Fix typo and punctuation mark
2018-06-05 15:38:39 -07:00
swift-ci
4c4b778702 Merge remote-tracking branch 'origin/master' into master-next 2018-06-04 14:49:23 -07:00
Karoy Lorentey
325a63a1bd Merge pull request #16938 from lorentey/hashing-inlinable-audit
[stdlib] Audit inlinability of Hashable implementations
2018-06-04 14:36:20 -07:00
Doug Gregor
03aa3f189e [Standard library] Remove incorrect FIXME. 2018-06-01 08:56:18 -07:00
swift-ci
cf1bbe261d Merge remote-tracking branch 'origin/master' into master-next 2018-05-31 19:29:38 -07:00
Jordan Rose
cd5acad1b5 Remove unused property from _AnyHashableBox (#16926)
No functionality change.
2018-05-31 19:28:38 -07:00
Karoy Lorentey
bd802226fc [stdlib] Arrays: remove hashValue implementations
Remove hashValue implementations that can be generated by the compiler. (Modulo inlinability.)
2018-05-31 18:26:22 -07:00
Karoy Lorentey
07c1b74cc4 [stdlib] Audit inlinability of Hashable implementations
As a general rule, it is safe to mark the implementation of hash(into:) and _rawHashValue(seed:) for @_fixed_layout structs as inlinable.

However, some structs (like String guts, Character, KeyPath-related types) have complicated enough hashing that it seems counterproductive to inline them. Mark these with @effects(releasenone) instead.
2018-05-31 18:24:59 -07:00
swift-ci
568855a33c Merge remote-tracking branch 'origin/master' into master-next 2018-05-31 09:29:52 -07:00
Lily Vulcano
63348bce6f Merge pull request #16736 from millenomi/LinuxAsBridging_2
Turn on 'as' bridging for Linux (2)
2018-05-31 09:23:45 -07:00
Lily Vulcano
f7a28a8054 Strongly reduce the number of _typeByName() calls — cache the Foundation type, remove assertions. 2018-05-30 17:52:00 -07:00
Lily Vulcano
1377ab7d7e Turn on ‘as’ bridging on Darwin. 2018-05-30 15:07:22 -07:00
swift-ci
a8b1c204e1 Merge remote-tracking branch 'origin/master' into master-next 2018-05-30 14:29:08 -07:00