swift
ce925b6f - SIL: Don't allow conversions to form a noncopyable function.

Commit
1 day ago
SIL: Don't allow conversions to form a noncopyable function. A noncopyable closure owns its context, but a copyable closure's context can be shared, for example when the closure's only capture is used as the context. So a conversion must not turn a copyable function into a noncopyable one, or a consumer of the noncopyable function could destroy a context that something else still refers to. Reject a `convert_function` that forms a noncopyable function from a copyable one, and a `convert_escape_to_noescape` that changes execution semantics, in the SIL verifier. Make SILGen form such a value with a thunk instead.
Author
Committer
Parents
Loading