We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2ffeb36 + 7820ddc commit 9e8d65fCopy full SHA for 9e8d65f
stdlib/public/core/Unmanaged.swift
@@ -206,10 +206,10 @@ public struct Unmanaged<Instance: AnyObject> {
206
public func _withUnsafeGuaranteedRef<Result>(
207
_ body: (Instance) throws -> Result
208
) rethrows -> Result {
209
- let (guaranteedInstance, token) = Builtin.unsafeGuaranteed(_value)
210
- let result = try body(guaranteedInstance)
211
- Builtin.unsafeGuaranteedEnd(token)
212
- return result
+ var tmp = self
+ let fakeBase: Int? = nil
+ return try body(Builtin.convertUnownedUnsafeToGuaranteed(fakeBase,
+ &tmp._value))
213
}
214
215
/// Performs an unbalanced retain of the object.
0 commit comments