Skip to content

Commit e6e8788

Browse files
Azoylorentey
andauthored
Take doc suggestion from Karoy #2
Co-authored-by: Karoy Lorentey <[email protected]>
1 parent f28ebc9 commit e6e8788

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

stdlib/public/core/Unmanaged.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ public struct Unmanaged<Instance: AnyObject> {
5656
/// - Returns: An opaque pointer to the value of this unmanaged reference.
5757
@_transparent
5858
public func toOpaque() -> UnsafeMutableRawPointer {
59-
// NOTE: This function does not attempt to unsafeBitCast '_value' because
60-
// that will get a strong reference temporary value who the compiler will
59+
// NOTE: `self` is allowed to be a dangling reference.
60+
// Therefore, this function must not unsafeBitCast '_value' because
61+
// that will get a strong reference temporary value that the compiler will
6162
// try to retain/release. Use 'self' to avoid this. 'Unmanaged<Instance>' is
6263
// layout compatible with 'UnsafeRawPointer' and casting from that will not
6364
// attempt to retain the reference held at '_value'.

0 commit comments

Comments
 (0)