Skip to content

Commit

Permalink
Take doc suggestion from Karoy #2
Browse files Browse the repository at this point in the history
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
  • Loading branch information
Azoy and lorentey committed Jan 17, 2024
1 parent f28ebc9 commit e6e8788
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions stdlib/public/core/Unmanaged.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ public struct Unmanaged<Instance: AnyObject> {
/// - Returns: An opaque pointer to the value of this unmanaged reference.
@_transparent
public func toOpaque() -> UnsafeMutableRawPointer {
// NOTE: This function does not attempt to unsafeBitCast '_value' because
// that will get a strong reference temporary value who the compiler will
// NOTE: `self` is allowed to be a dangling reference.
// Therefore, this function must not unsafeBitCast '_value' because
// that will get a strong reference temporary value that the compiler will
// try to retain/release. Use 'self' to avoid this. 'Unmanaged<Instance>' is
// layout compatible with 'UnsafeRawPointer' and casting from that will not
// attempt to retain the reference held at '_value'.
Expand Down

0 comments on commit e6e8788

Please sign in to comment.