@@ -8492,18 +8492,23 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyConformsToConstraint(
8492
8492
return SolutionKind::Solved;
8493
8493
}
8494
8494
8495
- // Copyable is checked structurally, so for better performance, split apart
8496
- // this constraint into individual Copyable constraints on each tuple element.
8497
- if (auto *tupleType = type->getAs<TupleType>()) {
8498
- if (protocol->isSpecificProtocol(KnownProtocolKind::Copyable)) {
8499
- for (unsigned i = 0, e = tupleType->getNumElements(); i < e; ++i) {
8500
- addConstraint(ConstraintKind::ConformsTo,
8501
- tupleType->getElementType(i),
8502
- protocol->getDeclaredInterfaceType(),
8503
- locator.withPathElement(LocatorPathElt::TupleElement(i)));
8504
- }
8495
+ // FIXME: This is already handled by tuple conformance lookup path and
8496
+ // should be removed once non-copyable generics are enabled by default.
8497
+ if (!SWIFT_ENABLE_EXPERIMENTAL_NONCOPYABLE_GENERICS) {
8498
+ // Copyable is checked structurally, so for better performance, split apart
8499
+ // this constraint into individual Copyable constraints on each tuple
8500
+ // element.
8501
+ if (auto *tupleType = type->getAs<TupleType>()) {
8502
+ if (protocol->isSpecificProtocol(KnownProtocolKind::Copyable)) {
8503
+ for (unsigned i = 0, e = tupleType->getNumElements(); i < e; ++i) {
8504
+ addConstraint(
8505
+ ConstraintKind::ConformsTo, tupleType->getElementType(i),
8506
+ protocol->getDeclaredInterfaceType(),
8507
+ locator.withPathElement(LocatorPathElt::TupleElement(i)));
8508
+ }
8505
8509
8506
- return SolutionKind::Solved;
8510
+ return SolutionKind::Solved;
8511
+ }
8507
8512
}
8508
8513
}
8509
8514
0 commit comments