mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: Promote LexicalLifetimes feature to baseline.
This commit is contained in:
@@ -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)")
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
Reference in New Issue
Block a user