Skip to content

Commit cb3fc4b

Browse files
committed
Adopt sending and movesAsLike
1 parent 6b29e77 commit cb3fc4b

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

stdlib/public/Synchronization/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ set(SWIFT_SYNCHRNOIZATION_SWIFT_FLAGS
6464
"-enable-builtin-module"
6565
"-enable-experimental-feature" "RawLayout"
6666
"-enable-experimental-feature" "StaticExclusiveOnly"
67-
"-enable-experimental-feature" "TransferringArgsAndResults"
6867
"-enable-experimental-feature" "Extern"
6968
)
7069

stdlib/public/Synchronization/Cell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import Builtin
1515
@available(SwiftStdlib 6.0, *)
1616
@frozen
1717
@usableFromInline
18-
@_rawLayout(like: Value)
18+
@_rawLayout(like: Value, movesAsLike)
1919
internal struct _Cell<Value: ~Copyable>: ~Copyable {
2020
@available(SwiftStdlib 6.0, *)
2121
@_alwaysEmitIntoClient

stdlib/public/Synchronization/Mutex/Mutex.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public struct Mutex<Value: ~Copyable>: ~Copyable {
4747
@available(SwiftStdlib 6.0, *)
4848
@_alwaysEmitIntoClient
4949
@_transparent
50-
public init(_ initialValue: transferring consuming Value) {
50+
public init(_ initialValue: consuming sending Value) {
5151
value = _Cell(initialValue)
5252
}
5353
}
@@ -85,8 +85,8 @@ extension Mutex where Value: ~Copyable {
8585
@_alwaysEmitIntoClient
8686
@_transparent
8787
public borrowing func withLock<Result: ~Copyable, E: Error>(
88-
_ body: @Sendable (inout Value) throws(E) -> transferring Result
89-
) throws(E) -> transferring Result {
88+
_ body: @Sendable (inout Value) throws(E) -> sending Result
89+
) throws(E) -> sending Result {
9090
handle._lock()
9191

9292
defer {
@@ -132,8 +132,8 @@ extension Mutex where Value: ~Copyable {
132132
@_alwaysEmitIntoClient
133133
@_transparent
134134
public borrowing func withLockIfAvailable<Result: ~Copyable, E: Error>(
135-
_ body: @Sendable (inout Value) throws(E) -> transferring Result
136-
) throws(E) -> transferring Result? {
135+
_ body: @Sendable (inout Value) throws(E) -> sending Result
136+
) throws(E) -> sending Result? {
137137
guard handle._tryLock() else {
138138
return nil
139139
}

0 commit comments

Comments
 (0)