Skip to content

Commit 43b4be0

Browse files
committed
Add an experimental option TransferringArgsAndResults.
Just splitting off a larger commit to make this easier to review.
1 parent 5c3a18f commit 43b4be0

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

include/swift/Basic/Features.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,9 @@ EXPERIMENTAL_FEATURE(FixedArrays, true)
281281
// Group Main Actor Isolation Errors by Scope
282282
EXPERIMENTAL_FEATURE(GroupActorErrors, true)
283283

284+
// Allow for the 'transferring' keyword to be applied to arguments and results.
285+
EXPERIMENTAL_FEATURE(TransferringArgsAndResults, true)
286+
284287
#undef EXPERIMENTAL_FEATURE_EXCLUDED_FROM_MODULE_INTERFACE
285288
#undef EXPERIMENTAL_FEATURE
286289
#undef UPCOMING_FEATURE

lib/AST/ASTPrinter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3870,6 +3870,8 @@ static bool usesFeatureExtractConstantsFromMembers(Decl *decl) {
38703870

38713871
static bool usesFeatureBitwiseCopyable(Decl *decl) { return false; }
38723872

3873+
static bool usesFeatureTransferringArgsAndResults(Decl *decl) { return false; }
3874+
38733875
/// Suppress the printing of a particular feature.
38743876
static void suppressingFeature(PrintOptions &options, Feature feature,
38753877
llvm::function_ref<void()> action) {

lib/ASTGen/Sources/ASTGen/SourceFile.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ extension Parser.ExperimentalFeatures {
5555
mapFeature(.TypedThrows, to: .typedThrows)
5656
mapFeature(.DoExpressions, to: .doExpressions)
5757
mapFeature(.NonescapableTypes, to: .nonescapableTypes)
58+
mapFeature(.TransferringArgsAndResults, to: .transferringArgsAndResults)
5859
}
5960
}
6061

0 commit comments

Comments
 (0)