~Copyable should be read as "maybe-copyable", not "non-copyable".
For the purposes of the following discussion, let's take for granted that we should have noncopyable types in Swift; consider then how to add them.
First, every existing type is considered to conform to a new protocol, Copyable, even if they don't state : Copyable.
Then, every existing generic parameter is also considered to conform to Copyable even if it doesn't state it; if you don't do this then existing code like this won't compile any more:
func f<T>(_ t: T) {
print(t)
print(t)
}
So then, what syntax should be used to introduce a non-copyable type? Fortunately, Rust had tread these waters already, and Swift just followed Rust's solution: T: ~Copyable means "stop assuming the backward-compatible behavior that T: Copyable".
That makes sense of the generic parameter: <T: ~Copyable> means "this code may not assume T is Copyable", it doesn't mean that T isn't Copyable.
It also makes sense (though I have to squint a bit more) of the annotation on a type; struct S: ~Copyable means "this code may not assume that S is Copyable". You might ask, doesn't that mean that S isn't Copyable? But consider this case:
struct S<T: ~Copyable>: ~Copyable {
var t: T
}
extension S: Copyable where T: Copyable {}
Meaning, "S is Copyable if and only if T is Copyable". Now S is sometimes copyable. So in all cases, reading ~Copyable as "maybe-copyable" will help your understanding.
The original question was, "is this confusing". And I think the answer is, yes, it is confusing. But I also think that it's the only reasonable solution to the problem given the constraint of "we do want noncopyable types in Swift". Whether you believe that precondition, I'll leave up to youâŠ