mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Introduce InoutLifetimeDependence feature
This commit is contained in:
committed by
Meghana Gupta
parent
f4a980d62d
commit
493f0b782e
@@ -416,6 +416,9 @@ EXPERIMENTAL_FEATURE(StructLetDestructuring, true)
|
||||
/// Enable returning non-escapable types from functions.
|
||||
EXPERIMENTAL_FEATURE(LifetimeDependence, true)
|
||||
|
||||
/// Enable inout lifetime dependence - @lifetime(&arg)
|
||||
EXPERIMENTAL_FEATURE(InoutLifetimeDependence, true)
|
||||
|
||||
/// Enable the `@_staticExclusiveOnly` attribute.
|
||||
EXPERIMENTAL_FEATURE(StaticExclusiveOnly, true)
|
||||
|
||||
|
||||
@@ -271,6 +271,18 @@ static bool usesFeatureLifetimeDependence(Decl *decl) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool usesFeatureInoutLifetimeDependence(Decl *decl) {
|
||||
for (auto attr : decl->getAttrs().getAttributes<LifetimeAttr>()) {
|
||||
for (auto source : attr->getLifetimeEntry()->getSources()) {
|
||||
if (source.getParsedLifetimeDependenceKind() ==
|
||||
ParsedLifetimeDependenceKind::Inout) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
UNINTERESTING_FEATURE(DynamicActorIsolation)
|
||||
UNINTERESTING_FEATURE(NonfrozenEnumExhaustivity)
|
||||
UNINTERESTING_FEATURE(ClosureIsolation)
|
||||
|
||||
@@ -631,6 +631,7 @@ function(_compile_swift_files
|
||||
|
||||
list(APPEND swift_flags "-enable-experimental-feature" "NonescapableTypes")
|
||||
list(APPEND swift_flags "-enable-experimental-feature" "LifetimeDependence")
|
||||
list(APPEND swift_flags "-enable-experimental-feature" "InoutLifetimeDependence")
|
||||
|
||||
list(APPEND swift_flags "-enable-upcoming-feature" "MemberImportVisibility")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user