swift
244cce0a - allow move-only types to conform to `Sendable`

Commit
2 years ago
allow move-only types to conform to `Sendable` Part of the reason why we do not want to permit conformance to protocols for move-only types is that they're fundamentally wrong: all existing protocols assume the type is copyable, so we'd be allowing people to write conformances to things that are not actually true. The other aspect of it is that we may need to change the runtime representation for conformance descriptors of move-only types. So we can't have these conformances leaving residue at runtime. Luckily, that means marker protocols would be OK, since they leave no residue at runtime. So for, now we're going to specifically permit move-only types to conform to the marker protocol `Sendable` since it's needed for move-only types to work with concurrency. All of the existing rules about mixing move-only types with generics still apply. That means you still can't turn it into the existential `any Sendable` in any way at all, despite it conforming. The purpose of the conformance is purely to allow the concrete instances to cross actor isolation boundaries if it is actually `Sendable`. resolves rdar://104987062
Author
Committer
Parents
Loading