AST: Promote LexicalLifetimes feature to baseline.

This commit is contained in:
Allan Shortlidge
2024-07-08 22:34:49 -07:00
parent 5fb8082cc2
commit 53451caf49
3 changed files with 5 additions and 26 deletions

View File

@@ -179,7 +179,7 @@ BASELINE_LANGUAGE_FEATURE(ExtensionMacros, 402, "Extension macros")
BASELINE_LANGUAGE_FEATURE(MoveOnly, 390, "noncopyable types")
BASELINE_LANGUAGE_FEATURE(MoveOnlyResilientTypes, 390, "non-@frozen noncopyable types with library evolution")
BASELINE_LANGUAGE_FEATURE(ParameterPacks, 393, "Value and type parameter packs")
SUPPRESSIBLE_LANGUAGE_FEATURE(LexicalLifetimes, 0, "@_eagerMove/@_noEagerMove/@_lexicalLifetimes annotations")
BASELINE_LANGUAGE_FEATURE(LexicalLifetimes, 0, "@_eagerMove/@_noEagerMove/@_lexicalLifetimes annotations")
BASELINE_LANGUAGE_FEATURE(FreestandingMacros, 397, "freestanding declaration macros")
SUPPRESSIBLE_LANGUAGE_FEATURE(RetroactiveAttribute, 364, "@retroactive")
SUPPRESSIBLE_LANGUAGE_FEATURE(ExtensionMacroAttr, 0, "@attached(extension)")

View File

@@ -155,12 +155,6 @@ static bool hasParameterPacks(Decl *decl) {
return false;
}
static bool usesFeatureLexicalLifetimes(Decl *decl) {
return decl->getAttrs().hasAttribute<EagerMoveAttr>() ||
decl->getAttrs().hasAttribute<NoEagerMoveAttr>() ||
decl->getAttrs().hasAttribute<LexicalLifetimesAttr>();
}
static bool usesFeatureRetroactiveAttribute(Decl *decl) {
auto ext = dyn_cast<ExtensionDecl>(decl);
if (!ext)

View File

@@ -4,32 +4,17 @@
// RUN: %target-swift-typecheck-module-from-interface(%t/FeatureTest.swiftinterface) -module-name FeatureTest -disable-availability-checking
// RUN: %FileCheck %s < %t/FeatureTest.swiftinterface
// CHECK: #if compiler(>=5.3) && $LexicalLifetimes
// CHECK-NEXT: @_noEagerMove public struct Permanent {
// CHECK: @_noEagerMove public struct Permanent {
// CHECK-NEXT: }
// CHECK-NEXT: #else
// CHECK-NEXT: public struct Permanent {
// CHECK-NEXT: }
// CHECK-NEXT: #endif
@_noEagerMove
public struct Permanent {}
// CHECK: #if compiler(>=5.3) && $LexicalLifetimes
// CHECK-NEXT: @_hasMissingDesignatedInitializers @_eagerMove public class Transient {
// CHECK: @_hasMissingDesignatedInitializers @_eagerMove public class Transient {
// CHECK-NEXT: deinit
// CHECK-NEXT: }
// CHECK-NEXT: #else
// CHECK-NEXT: @_hasMissingDesignatedInitializers public class Transient {
// CHECK-NEXT: deinit
// CHECK-NEXT: }
// CHECK-NEXT: #endif
@_eagerMove
@_eagerMove
public class Transient {}
// CHECK: #if compiler(>=5.3) && $LexicalLifetimes
// CHECK-NEXT: @_lexicalLifetimes public func lexicalInAModuleWithoutLexicalLifetimes(_ t: FeatureTest.Transient)
// CHECK-NEXT: #else
// CHECK-NEXT: public func lexicalInAModuleWithoutLexicalLifetimes(_ t: FeatureTest.Transient)
// CHECK-NEXT: #endif
// CHECK: @_lexicalLifetimes public func lexicalInAModuleWithoutLexicalLifetimes(_ t: FeatureTest.Transient)
@_lexicalLifetimes
public func lexicalInAModuleWithoutLexicalLifetimes(_ t: Transient) {}