mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
ConvertFunction and reabstraction thunks need this attribute. Otherwise, there is no way to identify that withoutActuallyEscaping was used to explicitly perform a conversion. The destination of a [without_actually_escaping] conversion always has an escaping function type. The source may have either an escaping or @noescape function type. The conversion itself may be a nop, and there is nothing distinctive about it. The thing that is special about these conversions is that the source function type may have unboxed captures. i.e. they have @inout_aliasable parameters. Exclusivity requires that the compiler enforce a SIL data flow invariant that nonescaping closures with unboxed captures can never be stored or passed as an @escaping function argument. Adding this attribute allows the compiler to enforce the invariant in general with an escape hatch for withoutActuallyEscaping.
50 KiB
50 KiB