mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: Promote ConformanceSuppression feature to baseline.
This commit is contained in:
@@ -195,7 +195,7 @@ BASELINE_LANGUAGE_FEATURE(MoveOnlyPartialConsumption, 429, "Partial consumption
|
||||
BASELINE_LANGUAGE_FEATURE(BitwiseCopyable, 426, "BitwiseCopyable protocol")
|
||||
BASELINE_LANGUAGE_FEATURE(NoncopyableGenerics, 427, "Noncopyable generics")
|
||||
BASELINE_LANGUAGE_FEATURE(NoncopyableGenerics2, 427, "Noncopyable generics alias")
|
||||
SUPPRESSIBLE_LANGUAGE_FEATURE(ConformanceSuppression, 426, "Suppressible inferred conformances")
|
||||
BASELINE_LANGUAGE_FEATURE(ConformanceSuppression, 426, "Suppressible inferred conformances")
|
||||
SUPPRESSIBLE_LANGUAGE_FEATURE(BitwiseCopyable2, 426, "BitwiseCopyable feature")
|
||||
LANGUAGE_FEATURE(BodyMacros, 415, "Function body macros")
|
||||
SUPPRESSIBLE_LANGUAGE_FEATURE(SendingArgsAndResults, 430, "Sending arg and results")
|
||||
|
||||
@@ -3064,17 +3064,6 @@ static void suppressingFeatureAssociatedTypeImplements(PrintOptions &options,
|
||||
options.ExcludeAttrList.resize(originalExcludeAttrCount);
|
||||
}
|
||||
|
||||
static void
|
||||
suppressingFeatureConformanceSuppression(PrintOptions &options,
|
||||
llvm::function_ref<void()> action) {
|
||||
unsigned originalExcludeAttrCount = options.ExcludeAttrList.size();
|
||||
options.ExcludeAttrList.push_back(DeclAttrKind::PreInverseGenerics);
|
||||
llvm::SaveAndRestore<bool> scope(options.SuppressConformanceSuppression,
|
||||
true);
|
||||
action();
|
||||
options.ExcludeAttrList.resize(originalExcludeAttrCount);
|
||||
}
|
||||
|
||||
static void
|
||||
suppressingFeatureBitwiseCopyable2(PrintOptions &options,
|
||||
llvm::function_ref<void()> action) {
|
||||
|
||||
@@ -308,42 +308,6 @@ UNINTERESTING_FEATURE(NonfrozenEnumExhaustivity)
|
||||
|
||||
UNINTERESTING_FEATURE(ClosureIsolation)
|
||||
|
||||
static bool usesFeatureConformanceSuppression(Decl *decl) {
|
||||
auto *nominal = dyn_cast<NominalTypeDecl>(decl);
|
||||
if (!nominal)
|
||||
return false;
|
||||
|
||||
auto inherited = InheritedTypes(nominal);
|
||||
for (auto index : indices(inherited.getEntries())) {
|
||||
// Ensure that InheritedTypeRequest has set the isSuppressed bit if
|
||||
// appropriate.
|
||||
auto resolvedTy = inherited.getResolvedType(index);
|
||||
(void)resolvedTy;
|
||||
|
||||
auto entry = inherited.getEntry(index);
|
||||
|
||||
if (!entry.isSuppressed())
|
||||
continue;
|
||||
|
||||
auto ty = entry.getType();
|
||||
|
||||
if (!ty)
|
||||
continue;
|
||||
|
||||
auto kp = ty->getKnownProtocol();
|
||||
if (!kp)
|
||||
continue;
|
||||
|
||||
auto rpk = getRepressibleProtocolKind(*kp);
|
||||
if (!rpk)
|
||||
continue;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool usesFeatureBitwiseCopyable2(Decl *decl) {
|
||||
if (!decl->getModuleContext()->isStdlibModule()) {
|
||||
return false;
|
||||
|
||||
@@ -3,11 +3,6 @@
|
||||
// RUN: %FileCheck %s < %t.swiftinterface
|
||||
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface -module-name Mojuel)
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $ConformanceSuppression
|
||||
// CHECK-NEXT: public enum RecollectionOrganization<T> : ~Swift.BitwiseCopyable, Swift.Copyable where T : ~Copyable {
|
||||
// CHECK: public enum RecollectionOrganization<T> : ~Swift.BitwiseCopyable, Swift.Copyable where T : ~Copyable {
|
||||
// CHECK-NEXT: }
|
||||
// CHECK-NEXT: #else
|
||||
// CHECK-NEXT: public enum RecollectionOrganization<T> : Swift.Copyable where T : ~Copyable {
|
||||
// CHECK-NEXT: }
|
||||
// CHECK-NEXT: #endif
|
||||
public enum RecollectionOrganization<T : ~Copyable> : ~BitwiseCopyable, Copyable {}
|
||||
|
||||
Reference in New Issue
Block a user