mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Bypess lifetime dependence diagnostics completely for immortal values. We did
not do this initially because we wanted to potentially consider a value with a missing
dependency to mean that it could not escape the current function. But now we use
`Void` as a stand-in for immortal values.
This is needed for reassigning a Span/MutableSpan to an empty, immortal
Span:
func inoutToImmortal(_ s: inout RawSpan) {
let tmp = RawSpan(_unsafeBytes: UnsafeRawBufferPointer(start: nil, count: 0))
s = _overrideLifetime(tmp, borrowing: ())
}
Fixes rdar://152572002 ([GH:#81976] Cannot reinitialize inout parameter of type
`MutableSpan<T>?`)
23 KiB
23 KiB