mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Correctly generate dependency tracking for functions that return a non-Escapable existential, such as: func getMutableSpanWithOpaqueReturn(_ array: inout [Int]) -> any PAny & ~Copyable & ~Escapable Previously, dependency insertion assumed that @out storage always initialized an alloc_stack. But existentials are always boxed. First, add a diagnostic to catch any missing dependency insertions now that we're past the bootstrapping phase. Then, generalize handling of dependency insertion to handle any access base as long as it has a recognizable address source. Fixes rdar://150388126 (Missing mark_dependence for opaque lifetime dependent value)