Skip to content

Commit b421b1a

Browse files
authored
Merge pull request #73544 from kavon/kavon/fix-comment-5-9-2024
NFC: use clear terminology
2 parents e7e2ad1 + b5383ab commit b421b1a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/AST/FeatureSet.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ UNINTERESTING_FEATURE(SuppressedAssociatedTypes)
508508

509509
static bool disallowFeatureSuppression(StringRef featureName, Decl *decl);
510510

511-
static bool allBoundTypesAreCopyable(Type type, DeclContext *context) {
511+
static bool allSubstTypesAreCopyable(Type type, DeclContext *context) {
512512
assert(type->getAnyNominal());
513513
auto bgt = type->getAs<BoundGenericType>();
514514
if (!bgt)
@@ -549,11 +549,14 @@ static bool usesFeatureNoncopyableGenerics(Decl *decl) {
549549
return false;
550550

551551
// If we only _refer_ to a TypeDecl that uses NoncopyableGenerics,
552-
// and a suppressed version of that decl is in the interface, then we're
553-
// only referring to the un-suppressed version if any of the bound types
554-
// are noncopyable. (rdar://127389991)
552+
// and a suppressed version of that decl is in the interface, and
553+
// if we only substitute Copyable types for the generic parameters,
554+
// then we can say this decl is not "using" the feature such that
555+
// a feature guard is required. In other words, this reference to the
556+
// type will always be valid, regardless of whether the feature is
557+
// enabled or not. (rdar://127389991)
555558
if (!disallowFeatureSuppression("NoncopyableGenerics", nominalDecl)
556-
&& allBoundTypesAreCopyable(type, context)) {
559+
&& allSubstTypesAreCopyable(type, context)) {
557560
return false;
558561
}
559562

0 commit comments

Comments
 (0)