Skip to content

Commit e7ae787

Browse files
committed
AST: Promote ConformanceSuppression feature to baseline.
1 parent b46f23b commit e7ae787

File tree

4 files changed

+2
-54
lines changed

4 files changed

+2
-54
lines changed

include/swift/Basic/Features.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ BASELINE_LANGUAGE_FEATURE(MoveOnlyPartialConsumption, 429, "Partial consumption
195195
BASELINE_LANGUAGE_FEATURE(BitwiseCopyable, 426, "BitwiseCopyable protocol")
196196
BASELINE_LANGUAGE_FEATURE(NoncopyableGenerics, 427, "Noncopyable generics")
197197
BASELINE_LANGUAGE_FEATURE(NoncopyableGenerics2, 427, "Noncopyable generics alias")
198-
SUPPRESSIBLE_LANGUAGE_FEATURE(ConformanceSuppression, 426, "Suppressible inferred conformances")
198+
BASELINE_LANGUAGE_FEATURE(ConformanceSuppression, 426, "Suppressible inferred conformances")
199199
SUPPRESSIBLE_LANGUAGE_FEATURE(BitwiseCopyable2, 426, "BitwiseCopyable feature")
200200
LANGUAGE_FEATURE(BodyMacros, 415, "Function body macros")
201201
SUPPRESSIBLE_LANGUAGE_FEATURE(SendingArgsAndResults, 430, "Sending arg and results")

lib/AST/ASTPrinter.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3064,17 +3064,6 @@ static void suppressingFeatureAssociatedTypeImplements(PrintOptions &options,
30643064
options.ExcludeAttrList.resize(originalExcludeAttrCount);
30653065
}
30663066

3067-
static void
3068-
suppressingFeatureConformanceSuppression(PrintOptions &options,
3069-
llvm::function_ref<void()> action) {
3070-
unsigned originalExcludeAttrCount = options.ExcludeAttrList.size();
3071-
options.ExcludeAttrList.push_back(DeclAttrKind::PreInverseGenerics);
3072-
llvm::SaveAndRestore<bool> scope(options.SuppressConformanceSuppression,
3073-
true);
3074-
action();
3075-
options.ExcludeAttrList.resize(originalExcludeAttrCount);
3076-
}
3077-
30783067
static void
30793068
suppressingFeatureBitwiseCopyable2(PrintOptions &options,
30803069
llvm::function_ref<void()> action) {

lib/AST/FeatureSet.cpp

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -308,42 +308,6 @@ UNINTERESTING_FEATURE(NonfrozenEnumExhaustivity)
308308

309309
UNINTERESTING_FEATURE(ClosureIsolation)
310310

311-
static bool usesFeatureConformanceSuppression(Decl *decl) {
312-
auto *nominal = dyn_cast<NominalTypeDecl>(decl);
313-
if (!nominal)
314-
return false;
315-
316-
auto inherited = InheritedTypes(nominal);
317-
for (auto index : indices(inherited.getEntries())) {
318-
// Ensure that InheritedTypeRequest has set the isSuppressed bit if
319-
// appropriate.
320-
auto resolvedTy = inherited.getResolvedType(index);
321-
(void)resolvedTy;
322-
323-
auto entry = inherited.getEntry(index);
324-
325-
if (!entry.isSuppressed())
326-
continue;
327-
328-
auto ty = entry.getType();
329-
330-
if (!ty)
331-
continue;
332-
333-
auto kp = ty->getKnownProtocol();
334-
if (!kp)
335-
continue;
336-
337-
auto rpk = getRepressibleProtocolKind(*kp);
338-
if (!rpk)
339-
continue;
340-
341-
return true;
342-
}
343-
344-
return false;
345-
}
346-
347311
static bool usesFeatureBitwiseCopyable2(Decl *decl) {
348312
if (!decl->getModuleContext()->isStdlibModule()) {
349313
return false;

test/ModuleInterface/conformance_suppression.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
// RUN: %FileCheck %s < %t.swiftinterface
44
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface -module-name Mojuel)
55

6-
// CHECK: #if compiler(>=5.3) && $ConformanceSuppression
7-
// CHECK-NEXT: public enum RecollectionOrganization<T> : ~Swift.BitwiseCopyable, Swift.Copyable where T : ~Copyable {
6+
// CHECK: public enum RecollectionOrganization<T> : ~Swift.BitwiseCopyable, Swift.Copyable where T : ~Copyable {
87
// CHECK-NEXT: }
9-
// CHECK-NEXT: #else
10-
// CHECK-NEXT: public enum RecollectionOrganization<T> : Swift.Copyable where T : ~Copyable {
11-
// CHECK-NEXT: }
12-
// CHECK-NEXT: #endif
138
public enum RecollectionOrganization<T : ~Copyable> : ~BitwiseCopyable, Copyable {}

0 commit comments

Comments
 (0)