Skip to content

Commit 60cdbb8

Browse files
committed
[Features] Move NoncopyableGenerics up.
Some compilers have the NoncopyableGenerics feature enabled via interesting mechanisms but do not have ConformanceSuppression. To support such compilers, the NoncopyableGenerics feature must appear before ConformanceSuppression in the list of features. Otherwise, when parsing the portion of the swiftinterface corresponding to an entity which involves both features, the first check will be for NoncopyableGenerics (which that old compiler has) and the code inside will involve ConformanceSuppression (which that old compiler does not have). rdar://128611158
1 parent 478d8a6 commit 60cdbb8

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

include/swift/Basic/Features.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ SUPPRESSIBLE_LANGUAGE_FEATURE(AssociatedTypeImplements, 0, "@_implements on asso
192192
LANGUAGE_FEATURE(BuiltinAddressOfRawLayout, 0, "Builtin.addressOfRawLayout")
193193
LANGUAGE_FEATURE(MoveOnlyPartialConsumption, 429, "Partial consumption of noncopyable values")
194194
LANGUAGE_FEATURE(BitwiseCopyable, 426, "BitwiseCopyable protocol")
195+
SUPPRESSIBLE_LANGUAGE_FEATURE(NoncopyableGenerics, 427, "Noncopyable generics")
195196
SUPPRESSIBLE_LANGUAGE_FEATURE(ConformanceSuppression, 426, "Suppressible inferred conformances")
196197
SUPPRESSIBLE_LANGUAGE_FEATURE(BitwiseCopyable2, 426, "BitwiseCopyable feature")
197-
SUPPRESSIBLE_LANGUAGE_FEATURE(NoncopyableGenerics, 427, "Noncopyable generics")
198198
LANGUAGE_FEATURE(BodyMacros, 415, "Function body macros")
199199

200200
// Swift 6
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s -module-name Mojuel
3+
// RUN: %FileCheck %s < %t.swiftinterface
4+
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface -module-name Mojuel)
5+
6+
// CHECK: #if compiler(>=5.3) && $ConformanceSuppression
7+
// CHECK-NEXT: public enum RecollectionOrganization<T> : ~Swift.BitwiseCopyable, Swift.Copyable where T : ~Copyable {
8+
// CHECK-NEXT: }
9+
// CHECK-NEXT: #elseif compiler(>=5.3) && $NoncopyableGenerics
10+
// CHECK-NEXT: public enum RecollectionOrganization<T> : Swift.Copyable where T : ~Copyable {
11+
// CHECK-NEXT: }
12+
// CHECK-NEXT: #else
13+
// CHECK-NEXT: public enum RecollectionOrganization<T> {
14+
// CHECK-NEXT: }
15+
// CHECK-NEXT: #endif
16+
public enum RecollectionOrganization<T : ~Copyable> : ~BitwiseCopyable, Copyable {}

0 commit comments

Comments
 (0)