mirror of
https://github.com/apple/swift.git
synced 2026-02-27 18:26:24 +01:00
A mutable capture is always escaping. Naturally, you can't mutably capture a non-Escapable value. Nonetheless, code may override the lifetime of the captured value as immortal, knowing that the closure does not actually escape. '_overrideLifetime(capturedThing, copying: ())' quiets the diagnostics on the caller side. But, when diagnosing the closure body itself, lifetime analysis is upset by the boxed non-Escaping value. Simply add a case to LocalVariableAccessMap to recognize this as a valid case so that diagnostics can ignore it. Fixes rdar://170592353 (error: lifetime-dependent variable 'overriddenLifetime' escapes its scope)