Commit Graph

7762 Commits

Author SHA1 Message Date
swift-ci
2183c1d21a Merge remote-tracking branch 'origin/main' into rebranch 2022-06-29 15:13:35 -07:00
Steven Wu
ea31a9222f stdlib: Fix the name mangling for UnsafeMutableRawPointer.storeBytes
The name mangling for storeBytes is missing `$`.

rdar://96062712
2022-06-29 09:52:51 -07:00
swift-ci
306440cd76 Merge remote-tracking branch 'origin/main' into rebranch 2022-06-24 10:53:37 -07:00
Karoy Lorentey
789545d1be Merge pull request #41843 from lorentey/adopt-primary-associated-types
[SE-0358][stdlib] Adopt primary associated types
2022-06-24 10:46:29 -07:00
swift-ci
89d5dc978f Merge remote-tracking branch 'origin/main' into rebranch 2022-06-23 14:14:59 -07:00
Slava Pestov
2734f3ca05 stdlib: Add SIMDMaskScalar.SIMDMaskScalar == SIMDMaskScalar requirement to SIMDScalar
In theory this is a source break if someone had a weird custom
conforming type, but I suspect in practice conformances to
this protocol are never defined.

The reason we want this requirement is that often you will see
code like the following:

  protocol Point {
    associatedtype Scalar: SIMDScalar
    associatedtype Vector: SIMD where Vector.Scalar == Scalar
  }

  extension Point where Vector == SIMD2<Scalar> { ... }

When `Vector` is equated with `SIMD2<Scalar>`, we get an infinite
sequence of implied same-type requirements:

  Vector.MaskStorage == SIMD2<Scalar.MaskScalar>
  Vector.MaskStorage.MaskStorage == SIMD2<Scalar.MaskScalar.MaskScalar>
  ...

The protocol fails to typecheck with an error because the requirement
machine cannot build a rewrite system.

If SIMDScalar requires that MaskScalar.MaskScalar == MaskScalar, then
we instead get

  Vector.MaskStorage == SIMD2<Scalar.MaskScalar>
  Vector.MaskStorage.MaskStorage == SIMD2<Scalar.MaskScalar>

  Vector.MaskStorage.MaskStorage == Vector.MaskStorage
  ...

Which ties off the recursion.

In theory, a more advanced implementation could represent this kind of
infinite recursion in 'closed form', but we don't have that yet, and I
believe adding this same-type requirement makes sense anyway.

Fixes rdar://problem/95075552.
2022-06-22 21:26:15 -04:00
Karoy Lorentey
2759a710e6 [stdlib] OptionSet: Remove the primary associated type declaration
`Element` is expected to always be `Self`. `RawValue` would be a better choice for the primary type ("option set of UInt32"), but to avoid confusion, it seems better to just omit the declaration, at least for now.
2022-06-22 17:22:18 -07:00
swift-ci
b8f39b56be Merge remote-tracking branch 'origin/main' into rebranch 2022-06-22 09:15:09 -07:00
Alejandro Alonso
95da55b182 [stdlib] Implement String.WordView (#42414)
* Implement String.WordView

* Add isWordAligned bit

* Hide WordView for now (also separate Index type)

add bidirectional conformance

Fix tests

* Address comments from Karoy and Michael

* Remove word view, use index methods

* Address Karoy's comments

aaa
2022-06-22 09:10:09 -07:00
swift-ci
c6d6dc5bc0 Merge remote-tracking branch 'origin/main' into rebranch 2022-06-22 07:54:04 -07:00
Guillaume Lessard
69392a772a Merge pull request #59327 from glessard/rdar46444561-optional-equality-operator
[stdlib] use @_transparent in an appropriate spot
2022-06-22 08:39:42 -06:00
swift-ci
8bc1fbdada Merge remote-tracking branch 'origin/main' into rebranch 2022-06-21 21:53:58 -07:00
Mishal Shah
475ed80c3e Update the SwiftStdlib 5.7 availability 2022-06-21 15:23:10 -07:00
swift-ci
ed378ecae8 Merge remote-tracking branch 'origin/main' into rebranch 2022-06-13 19:54:01 -07:00
Karoy Lorentey
01d7b5799c [stdlib] Fix handling of duplicate items in generic Set.intersection
If the sequence passed to `Set.intersection` has exactly as many duplicate items as items missing from `self`, then the new implementation in 5.6 will mistakenly return `self` unchanged. (It counts duplicate hits as distinct items in the result.)

rdar://94803458
2022-06-13 14:12:48 -07:00
swift-ci
d6fceb79c5 Merge remote-tracking branch 'origin/main' into rebranch 2022-06-13 11:53:47 -07:00
Karoy Lorentey
2da382dc6b Merge pull request #59243 from rctcwyvrn/lily-dictionary-optimization
Optimize Dictionary.filter for native dictionaries
2022-06-13 11:47:12 -07:00
swift-ci
88de6f4757 Merge remote-tracking branch 'origin/main' into rebranch 2022-06-10 13:13:37 -07:00
swift-ci
e78643c08a Merge pull request #59143 from fulldecent/patch-1
Correct complexity statement for Sequence compactMap
2022-06-10 13:03:04 -07:00
swift-ci
8c515e418a Merge remote-tracking branch 'origin/main' into rebranch 2022-06-10 12:32:53 -07:00
Guillaume Lessard
4dffe2716f Merge pull request #59330 from glessard/rdar94296845-assertionFailure-docs
[docs] improvements for assertionFailure and preconditionFailure
2022-06-10 13:15:16 -06:00
swift-ci
8a59b92e7d Merge remote-tracking branch 'origin/main' into rebranch 2022-06-10 11:13:11 -07:00
Karoy Lorentey
6d2d2e0005 Merge pull request #38091 from glessard/indexing-model
[stdlib] fix an indexing inconsistency
2022-06-10 11:02:13 -07:00
Karoy Lorentey
35fc9ea772 Merge pull request #59117 from glessard/se0349-doctweak
[doc] mention `loadUnaligned` in the description of `UnsafeRawBufferPointer`
2022-06-10 11:00:59 -07:00
swift-ci
3597ca75f0 Merge remote-tracking branch 'origin/main' into rebranch 2022-06-09 02:52:39 -07:00
Guillaume Lessard
7a157f99ab [stdlib] use @_transparent in an appropriate spot 2022-06-08 13:49:18 -06:00
Guillaume Lessard
6219ae998d [docs] improvements for assertionFailure and preconditionFailure
- the previous docs for assertionFailure implies that it is a nonreturning function, which has always been wrong.
- the example usage previously given for assertionFailure was moved to preconditionFailure, where it is more appropriate.
2022-06-08 13:43:19 -06:00
Alastair Houghton
33f103f03e [Build] Fix some issues with the standalone library build.
When we're building static libraries, we don't need to include the
threading objects in both Concurrency and Core, and we also don't need
two copies of the threading library's fatal error handler.

rdar://90776105
2022-06-07 07:39:53 +01:00
Alastair Houghton
05cccf939b [Runtime][Windows] Need to link with Synchronization.lib.
We're using some functions from Synchronization.lib now, after the
threading changes.

rdar://90776105
2022-06-07 07:39:52 +01:00
Alastair Houghton
f5bdb858e0 [Threading] Create new threading library and use it.
Moved all the threading code to one place.  Added explicit support for
Darwin, Linux, Pthreads, C11 threads and Win32 threads, including new
implementations of Once for Linux, Pthreads, C11 and Win32.

rdar://90776105
2022-06-07 07:39:51 +01:00
Lily Lin
a56e658df9 Fix ABI issue in NativeDictionary 2022-06-03 16:49:50 -07:00
Lily Lin
fbd70fe6eb Fix build error for linux builds and add basic validation test 2022-06-03 15:26:06 -07:00
Lily Lin
c6c0229070 Merge branch 'main' into lily-dictionary-optimization 2022-06-03 14:21:07 -07:00
Lily Lin
261216969b Optimize Dictionary.filter for native dictionaries 2022-06-02 16:07:44 -07:00
Ben Barham
65ed78d3e7 Merge branch 'main' into manually-merge-main 2022-06-02 10:14:57 -07:00
Alex Hoppen
4aa2bbbf06 Revert "Merge pull request #42447 from al45tair/eng/PR-90776105"
This reverts commit 8bcb71140f, reversing
changes made to c4dd271d36.
2022-06-02 18:03:23 +02:00
swift-ci
9a0978a5a2 Merge pull request #59200 from glessard/se-unaligned-loads-docs
[docs] fix a parameter description for storeBytes
2022-06-01 13:19:06 -07:00
Alastair Houghton
8bcb71140f Merge pull request #42447 from al45tair/eng/PR-90776105
[Build][Runtime] Add a new threading library.
2022-06-01 12:57:23 -07:00
Guillaume Lessard
0895934303 [docs] fix a parameter description for storeBytes 2022-06-01 09:04:43 -06:00
swift-ci
5deeaf14dc Merge remote-tracking branch 'origin/main' into rebranch 2022-06-01 03:33:57 -07:00
Daniel Duan
c368d73b5b [stdlib] Delete unused gyb variable (#59197)
This variable is no longer referenced anywhere.
2022-06-01 03:15:15 -07:00
swift-ci
d44f0650cb Merge remote-tracking branch 'origin/main' into rebranch 2022-05-31 17:33:55 -07:00
Guillaume Lessard
11138424a7 [docs] clarify docs for load, loadUnaligned and storeBytes
- outdated and incorrect information removed
2022-05-31 15:55:09 -06:00
Alastair Houghton
68dfde2405 [Build] Fix some issues with the standalone library build.
When we're building static libraries, we don't need to include the
threading objects in both Concurrency and Core, and we also don't need
two copies of the threading library's fatal error handler.

rdar://90776105
2022-05-31 16:08:20 +01:00
William Entriken
81b0d3a27f Correct complexity statement for Sequence compactMap 2022-05-28 14:59:46 -04:00
Guillaume Lessard
d6165cd83d [doc] mention loadUnaligned in URBP description 2022-05-26 14:09:00 -06:00
Alastair Houghton
848b6b53f0 [Runtime][Windows] Need to link with Synchronization.lib.
We're using some functions from Synchronization.lib now, after the
threading changes.

rdar://90776105
2022-05-24 14:57:40 +01:00
Alastair Houghton
63a09007a1 [Threading] Create new threading library and use it.
Moved all the threading code to one place.  Added explicit support for
Darwin, Linux, Pthreads, C11 threads and Win32 threads, including new
implementations of Once for Linux, Pthreads, C11 and Win32.

rdar://90776105
2022-05-24 14:57:39 +01:00
swift-ci
7a6fa5b0a5 Merge remote-tracking branch 'origin/main' into rebranch 2022-05-19 14:14:19 -07:00
Karoy Lorentey
95dff4d55b [stdlib] Define version 5.8 of the stdlib 2022-05-18 13:55:32 -07:00