mirror of
https://github.com/apple/swift.git
synced 2026-11-01 23:11:50 +01:00
Add `Deinitable` as a third invertible protocol for types whose values can be destroyed implicitly. By default, all `Copyable` types are `Deinitable`. The compiler reserves `Deinitable` for its own use so currently source code outside the standard library can't refer to it. This lays the groundwork for modeling the types of functions that can be called exactly-once as `~Deinitable`. Every type implicitly conforms to `Deinitable` for now. Since `Copyable` inherits from `Deinitable` there is no change to most generic signatures. That requirement is a default, so it isn't mangled or printed, and existing symbols don't change. Only `~Copyable` parameters need to gain a stated implicit `Deinitable` requirement. Compiler-synthesized signatures that are fully unconstrained, such as the substituted signatures of reabstraction thunks, now lack `Deinitable`, so the names of those non-exported symbols mangle the new inverse but this doesn't have any ABI impact.