mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[nfc] rename or eliminate isPureMoveOnly APIs
I think from SIL's perspective, it should only worry about whether the type is move-only. That includes MoveOnlyWrapped SILTypes and regular types that cannot be copied. Most of the code querying `SILType::isPureMoveOnly` is in SILGen, where it's very likely that the original AST type is sitting around already. In such cases, I think it's fine to ask the AST type if it is noncopyable. The clarity of only asking the ASTType if it's noncopyable is beneficial, I think.
This commit is contained in:
@@ -3865,7 +3865,7 @@ ConstraintSystem::matchExistentialTypes(Type type1, Type type2,
|
||||
}
|
||||
|
||||
// move-only types (and their metatypes) cannot match with existential types.
|
||||
if (type1->getMetatypeInstanceType()->isPureMoveOnly()) {
|
||||
if (type1->getMetatypeInstanceType()->isNoncopyable()) {
|
||||
// tailor error message
|
||||
if (shouldAttemptFixes()) {
|
||||
auto *fix = MustBeCopyable::create(*this,
|
||||
@@ -11842,7 +11842,7 @@ ConstraintSystem::simplifyBridgingConstraint(Type type1,
|
||||
|
||||
// Move-only types can't be involved in a bridging conversion since a bridged
|
||||
// type assumes the ability to copy.
|
||||
if (type1->isPureMoveOnly()) {
|
||||
if (type1->isNoncopyable()) {
|
||||
return SolutionKind::Error;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user