Add explicit `Sendable` unavailability and add missing `Sendable` conformances
Found with -require-explicit-sendable compiler flag. We may want to enable this flag in CI but it currently warns also for internal types that are @usableFromInline but we could mark them explicitly as well if we wanted.
@FranzBusch eventually everything is either Sendable or not Sendable. We have this grey zone right now where the diagnostics severity is influenced by explicit or implicit marking but in Swift 6 mode this should no longer be the case.
@FranzBusch eventually everything is either Sendable or not Sendable.
I am unsure if that's true. In my head there are three distinct constraints Sendable not-Sendable and unavailable Sendable. The latter has some special treatment in the compiler right now and I am wondering if the region based isolation diagnostic also treats it differently or not. If it doesn't treat it differently then I am fine with marking everything as either Sendable or unavailable Sendable
@FranzBusch eventually everything is either Sendable or not Sendable.
I think this is fundamentally not true. Uninhabited types are neither Sendable nor not Sendable. They can certainly conform, but as a practical semantic matter they aren't Sendable or not Sendable because no values of them exist.
Similarly, Never conforms to Sendable, but you cannot send a Never.
Uninhabited types are neither Sendable nor not Sendable
I can't follow. You say yourself that Never is Sendable and Never is an uninhabited type which contradicts your statement above.
The only way a Type can "maybe" conform to a Protocol is through retroactive conformance. However, this isn't relevant as Sendable is a marker protocol and is checked at compile time only. Generics are another possible case where the concrete type might conform to Sendable but as Sendable is only checked at compile time this doesn't matter either.
I'm not saying uninhabited types can't conform to Sendable, I'm saying they can't be Sendable. That is, they can never satisfy the semantic requirement of the protocol. There are no values of uninhabited types, so you can never Send one.
Similarly, Never conforms to Equatable but you can never equate them.
This is why it's simply not worth arguing about whether they conform or not: their conformance is meaningless, and no correct code could possibly rely on it.