Skip to content

Commit 0444d29

Browse files
committed
[AST/Sema] SE-0487: Remove @preEnumExtensibility attribute
1 parent 43eec8f commit 0444d29

File tree

7 files changed

+2
-21
lines changed

7 files changed

+2
-21
lines changed

include/swift/AST/DeclAttr.def

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -888,11 +888,7 @@ SIMPLE_DECL_ATTR(concurrent, Concurrent,
888888
ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove | UnconstrainedInABIAttr,
889889
170)
890890

891-
SIMPLE_DECL_ATTR(preEnumExtensibility, PreEnumExtensibility,
892-
OnEnum,
893-
ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIBreakingToRemove | UnconstrainedInABIAttr,
894-
171)
895-
DECL_ATTR_FEATURE_REQUIREMENT(PreEnumExtensibility, NonexhaustiveAttribute)
891+
// Unused '171': Used to be `@preEnumExtensibility`
896892

897893
DECL_ATTR(specialized, Specialized,
898894
OnConstructor | OnFunc | OnAccessor,

include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8811,9 +8811,6 @@ ERROR(nonexhaustive_attr_on_internal_type,none,
88118811
"%select{private|fileprivate|internal|%error|%error|%error}1",
88128812
(DeclName, AccessLevel))
88138813

8814-
ERROR(pre_enum_extensibility_without_nonexhaustive,none,
8815-
"%0 can only be used together with '@nonexhaustive' attribute", (DeclAttribute))
8816-
88178814
//===----------------------------------------------------------------------===//
88188815
// MARK: `using` declaration
88198816
//===----------------------------------------------------------------------===//

lib/AST/ASTDumper.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5049,7 +5049,6 @@ class PrintAttribute : public AttributeVisitor<PrintAttribute, void, Label>,
50495049
TRIVIAL_ATTR_PRINTER(WeakLinked, weak_linked)
50505050
TRIVIAL_ATTR_PRINTER(Nonexhaustive, nonexhaustive)
50515051
TRIVIAL_ATTR_PRINTER(Concurrent, concurrent)
5052-
TRIVIAL_ATTR_PRINTER(PreEnumExtensibility, preEnumExtensibility)
50535052

50545053
#undef TRIVIAL_ATTR_PRINTER
50555054

lib/AST/ASTPrinter.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3327,8 +3327,7 @@ suppressingFeatureAddressableTypes(PrintOptions &options,
33273327
static void
33283328
suppressingFeatureNonexhaustiveAttribute(PrintOptions &options,
33293329
llvm::function_ref<void()> action) {
3330-
ExcludeAttrRAII scope1(options.ExcludeAttrList, DeclAttrKind::Nonexhaustive);
3331-
ExcludeAttrRAII scope2(options.ExcludeAttrList, DeclAttrKind::PreEnumExtensibility);
3330+
ExcludeAttrRAII scope(options.ExcludeAttrList, DeclAttrKind::Nonexhaustive);
33323331
action();
33333332
}
33343333

lib/ASTGen/Sources/ASTGen/DeclAttrs.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ extension ASTGenVisitor {
240240
.EagerMove,
241241
.Exported,
242242
.Nonexhaustive,
243-
.PreEnumExtensibility,
244243
.DiscardableResult,
245244
.DisfavoredOverload,
246245
.DynamicMemberLookup,

lib/Sema/TypeCheckAttr.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -248,14 +248,6 @@ class AttributeChecker : public AttributeVisitor<AttributeChecker> {
248248
}
249249
}
250250

251-
void visitPreEnumExtensibilityAttr(PreEnumExtensibilityAttr *attr) {
252-
if (!D->getAttrs().hasAttribute<NonexhaustiveAttr>()) {
253-
diagnoseAndRemoveAttr(
254-
attr, diag::pre_enum_extensibility_without_nonexhaustive, attr);
255-
return;
256-
}
257-
}
258-
259251
void visitConcurrentAttr(ConcurrentAttr *attr) {
260252
checkExecutionBehaviorAttribute(attr);
261253

lib/Sema/TypeCheckDeclOverride.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1615,7 +1615,6 @@ namespace {
16151615
UNINTERESTING_ATTR(Optimize)
16161616
UNINTERESTING_ATTR(Exclusivity)
16171617
UNINTERESTING_ATTR(Nonexhaustive)
1618-
UNINTERESTING_ATTR(PreEnumExtensibility)
16191618
UNINTERESTING_ATTR(NoLocks)
16201619
UNINTERESTING_ATTR(NoAllocation)
16211620
UNINTERESTING_ATTR(NoRuntime)

0 commit comments

Comments
 (0)