Skip to content

Commit 9999156

Browse files
committed
Use Builtin.addressOfRawLayout
1 parent d3c6780 commit 9999156

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

stdlib/public/Synchronization/Cell.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ internal struct _Cell<Value: ~Copyable>: ~Copyable {
2828
@_alwaysEmitIntoClient
2929
@_transparent
3030
var rawAddress: Builtin.RawPointer {
31-
Builtin.unprotectedAddressOfBorrow(self)
31+
#if $BuiltinAddressOfRawLayout
32+
Builtin.addressOfRawLayout(self)
33+
#else
34+
fatalError()
35+
#endif
3236
}
3337

3438
@available(SwiftStdlib 6.0, *)

stdlib/public/Synchronization/Mutex/Mutex.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
@_staticExclusiveOnly
3737
public struct Mutex<Value: ~Copyable>: ~Copyable {
3838
@usableFromInline
39-
let value: _Cell<Value>
39+
let handle = _MutexHandle()
4040

4141
@usableFromInline
42-
let handle = _MutexHandle()
42+
let value: _Cell<Value>
4343

4444
/// Initializes a value of this mutex with the given initial state.
4545
///

0 commit comments

Comments
 (0)