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.
1 parent 227c1c5 commit 2d2a181Copy full SHA for 2d2a181
stdlib/public/core/UnsafeRawPointer.swift
@@ -1418,10 +1418,11 @@ extension UnsafeMutableRawPointer {
1418
/// - type: The type of `value`.
1419
@inlinable
1420
@_alwaysEmitIntoClient
1421
- public func storeBytes<T: BitwiseCopyable>(
+ public func storeBytes<T: BitwiseCopyable & ~Escapable>(
1422
of value: T, toByteOffset offset: Int = 0, as type: T.Type
1423
) {
1424
- unsafe Builtin.storeRaw(value, (self + offset)._rawValue)
+ let immortalValue = unsafe _overrideLifetime(value, borrowing: ())
1425
+ unsafe Builtin.storeRaw(immortalValue, (self + offset)._rawValue)
1426
}
1427
1428
/// Stores the given value's bytes into raw memory at the specified offset.
0 commit comments