Commit Graph

29 Commits

Author SHA1 Message Date
Doug Gregor
9579390024 [SE-0304] Rename ConcurrentValue to Sendable 2021-03-18 22:48:20 -07:00
Doug Gregor
1a1f79c0de Introduce safety checkin for ConcurrentValue conformance.
Introduce checking of ConcurrentValue conformances:
- For structs, check that each stored property conforms to ConcurrentValue
- For enums, check that each associated value conforms to ConcurrentValue
- For classes, check that each stored property is immutable and conforms
  to ConcurrentValue

Because all of the stored properties / associated values need to be
visible for this check to work, limit ConcurrentValue conformances to
be in the same source file as the type definition.

This checking can be disabled by conforming to a new marker protocol,
UnsafeConcurrentValue, that refines ConcurrentValue.
UnsafeConcurrentValue otherwise his no specific meaning. This allows
both "I know what I'm doing" for types that manage concurrent access
themselves as well as enabling retroactive conformance, both of which
are fundamentally unsafe but also quite necessary.

The bulk of this change ended up being to the standard library, because
all conformances of standard library types to the ConcurrentValue
protocol needed to be sunk down into the standard library so they
would benefit from the checking above. There were numerous little
mistakes in the initial pass through the stsandard library types that
have now been corrected.
2021-02-04 03:45:09 -08:00
Nate Cook
a43cb01cbb Update ObjectIdentifier.swift
Co-authored-by: Xiaodi Wu <13952+xwu@users.noreply.github.com>
2020-10-23 15:13:03 -05:00
酷酷的哀殿
9c9c5da944 Update ObjectIdentifier.swift 2020-10-23 21:10:04 +08:00
酷酷的哀殿
16e541709e Update ObjectIdentifier.swift 2020-10-23 21:09:33 +08:00
酷酷的哀殿
a9af098560 Update ObjectIdentifier.swift 2020-10-22 22:43:31 +08:00
酷酷的哀殿
4a4c6c0f63 Update ObjectIdentifier.swift 2020-10-21 22:50:12 +08:00
酷酷的哀殿
c2159e2401 Update ObjectIdentifier.swift 2020-10-21 00:23:14 +08:00
酷酷的哀殿
59aff3e850 Update ObjectIdentifier.swift 2020-10-21 00:22:44 +08:00
酷酷的哀殿
e6fbb4b247 Update ObjectIdentifier.swift 2020-10-19 22:06:19 +08:00
酷酷的哀殿
cd74534052 [Docs] Clarifies ObjectIdentifier guarantees (#31472)
[SR-13564](https://bugs.swift.org/browse/SR-13564)
rdar://69169351
2020-10-19 21:54:50 +08:00
Paul Hudson
06f82a53b5 Replaced the majority of ' : ' with ': '. 2019-07-18 20:46:07 +01: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
Ben Cohen
397c22bf8f ObjectIdentifier needs to be fast and is trivial 2018-10-29 07:42:07 -07:00
Ben Cohen
92b6d8cb8f Remove inlineability from mirrors (#17476) 2018-06-25 19:54:13 -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
Nate Cook
7a4e0a32f6 [stdlib] Revise documentation
This includes various revisions to the APIs landing in Swift 4.2, including:
- Random and other randomness APIs
- Hashable changes
- MemoryLayout.offset(of:)
2018-05-18 11:31:54 -05:00
Karoy Lorentey
0342ce3b96 [SE-0206][stdlib] Remove obsolete hashValue implementations
These are now synthesized by the compiler.
(Inlinability will be different, but that seems fine.)
2018-04-30 10:17:09 +01:00
Karoy Lorentey
239c2c91dd [SE-0206][stdlib] Add missing hash(into:) declarations 2018-04-30 10:17:09 +01:00
Timm Preetz
46d36c8136 [gardening] Correct comment 2018-04-21 11:34:02 +02:00
Slava Pestov
e1f50b2d36 SE-0193: Rename @_inlineable to @inlinable, @_versioned to @usableFromInline 2018-03-30 21:55:30 -07:00
ben-cohen
d67c5f0025 Part the fourth 2017-12-01 14:06:14 -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
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
Dmitri Gribenko
46ef62db6e stdlib: move non-legacy parts of Reflection.swift into separate files 2016-09-03 17:39:55 -07:00