Skip to content

Commit 53451ca

Browse files
committed
AST: Promote LexicalLifetimes feature to baseline.
1 parent 5fb8082 commit 53451ca

File tree

3 files changed

+5
-26
lines changed

3 files changed

+5
-26
lines changed

include/swift/Basic/Features.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ BASELINE_LANGUAGE_FEATURE(ExtensionMacros, 402, "Extension macros")
179179
BASELINE_LANGUAGE_FEATURE(MoveOnly, 390, "noncopyable types")
180180
BASELINE_LANGUAGE_FEATURE(MoveOnlyResilientTypes, 390, "non-@frozen noncopyable types with library evolution")
181181
BASELINE_LANGUAGE_FEATURE(ParameterPacks, 393, "Value and type parameter packs")
182-
SUPPRESSIBLE_LANGUAGE_FEATURE(LexicalLifetimes, 0, "@_eagerMove/@_noEagerMove/@_lexicalLifetimes annotations")
182+
BASELINE_LANGUAGE_FEATURE(LexicalLifetimes, 0, "@_eagerMove/@_noEagerMove/@_lexicalLifetimes annotations")
183183
BASELINE_LANGUAGE_FEATURE(FreestandingMacros, 397, "freestanding declaration macros")
184184
SUPPRESSIBLE_LANGUAGE_FEATURE(RetroactiveAttribute, 364, "@retroactive")
185185
SUPPRESSIBLE_LANGUAGE_FEATURE(ExtensionMacroAttr, 0, "@attached(extension)")

lib/AST/FeatureSet.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,6 @@ static bool hasParameterPacks(Decl *decl) {
155155
return false;
156156
}
157157

158-
static bool usesFeatureLexicalLifetimes(Decl *decl) {
159-
return decl->getAttrs().hasAttribute<EagerMoveAttr>() ||
160-
decl->getAttrs().hasAttribute<NoEagerMoveAttr>() ||
161-
decl->getAttrs().hasAttribute<LexicalLifetimesAttr>();
162-
}
163-
164158
static bool usesFeatureRetroactiveAttribute(Decl *decl) {
165159
auto ext = dyn_cast<ExtensionDecl>(decl);
166160
if (!ext)

test/ModuleInterface/feature-LexicalLifetimes.swift

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,17 @@
44
// RUN: %target-swift-typecheck-module-from-interface(%t/FeatureTest.swiftinterface) -module-name FeatureTest -disable-availability-checking
55
// RUN: %FileCheck %s < %t/FeatureTest.swiftinterface
66

7-
// CHECK: #if compiler(>=5.3) && $LexicalLifetimes
8-
// CHECK-NEXT: @_noEagerMove public struct Permanent {
7+
// CHECK: @_noEagerMove public struct Permanent {
98
// CHECK-NEXT: }
10-
// CHECK-NEXT: #else
11-
// CHECK-NEXT: public struct Permanent {
12-
// CHECK-NEXT: }
13-
// CHECK-NEXT: #endif
149
@_noEagerMove
1510
public struct Permanent {}
1611

17-
// CHECK: #if compiler(>=5.3) && $LexicalLifetimes
18-
// CHECK-NEXT: @_hasMissingDesignatedInitializers @_eagerMove public class Transient {
19-
// CHECK-NEXT: deinit
20-
// CHECK-NEXT: }
21-
// CHECK-NEXT: #else
22-
// CHECK-NEXT: @_hasMissingDesignatedInitializers public class Transient {
12+
// CHECK: @_hasMissingDesignatedInitializers @_eagerMove public class Transient {
2313
// CHECK-NEXT: deinit
2414
// CHECK-NEXT: }
25-
// CHECK-NEXT: #endif
26-
@_eagerMove
15+
@_eagerMove
2716
public class Transient {}
2817

29-
// CHECK: #if compiler(>=5.3) && $LexicalLifetimes
30-
// CHECK-NEXT: @_lexicalLifetimes public func lexicalInAModuleWithoutLexicalLifetimes(_ t: FeatureTest.Transient)
31-
// CHECK-NEXT: #else
32-
// CHECK-NEXT: public func lexicalInAModuleWithoutLexicalLifetimes(_ t: FeatureTest.Transient)
33-
// CHECK-NEXT: #endif
18+
// CHECK: @_lexicalLifetimes public func lexicalInAModuleWithoutLexicalLifetimes(_ t: FeatureTest.Transient)
3419
@_lexicalLifetimes
3520
public func lexicalInAModuleWithoutLexicalLifetimes(_ t: Transient) {}

0 commit comments

Comments
 (0)