Skip to content

Commit 49dd54d

Browse files
Azoylorentey
authored andcommitted
Take doc suggestion from Karoy swiftlang#2
Co-authored-by: Karoy Lorentey <[email protected]>
1 parent 1d8b76b commit 49dd54d

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)