Skip to content

Commit b85da32

Browse files
committed
AST: Promote OptionalIsolatedParameters feature to baseline.
1 parent b396371 commit b85da32

File tree

7 files changed

+1
-39
lines changed

7 files changed

+1
-39
lines changed

include/swift/Basic/Features.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ BASELINE_LANGUAGE_FEATURE(FreestandingMacros, 397, "freestanding declaration mac
184184
SUPPRESSIBLE_LANGUAGE_FEATURE(RetroactiveAttribute, 364, "@retroactive")
185185
BASELINE_LANGUAGE_FEATURE(ExtensionMacroAttr, 0, "@attached(extension)")
186186
BASELINE_LANGUAGE_FEATURE(TypedThrows, 413, "Typed throws")
187-
CONDITIONALLY_SUPPRESSIBLE_LANGUAGE_FEATURE(OptionalIsolatedParameters, 420, "Optional isolated parameters")
187+
BASELINE_LANGUAGE_FEATURE(OptionalIsolatedParameters, 420, "Optional isolated parameters")
188188
BASELINE_LANGUAGE_FEATURE(Extern, 0, "@_extern")
189189
BASELINE_LANGUAGE_FEATURE(ExpressionMacroDefaultArguments, 422, "Expression macro as caller-side default argument")
190190
BASELINE_LANGUAGE_FEATURE(BuiltinStoreRaw, 0, "Builtin.storeRaw")

lib/AST/ASTPrinter.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3049,14 +3049,6 @@ static void suppressingFeatureIsolatedAny(PrintOptions &options,
30493049
action();
30503050
}
30513051

3052-
static void suppressingFeatureOptionalIsolatedParameters(
3053-
PrintOptions &options,
3054-
llvm::function_ref<void()> action) {
3055-
llvm::SaveAndRestore<bool> scope(
3056-
options.SuppressOptionalIsolatedParams, true);
3057-
action();
3058-
}
3059-
30603052
static void
30613053
suppressingFeatureSendingArgsAndResults(PrintOptions &options,
30623054
llvm::function_ref<void()> action) {

lib/AST/FeatureSet.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -73,25 +73,6 @@ static bool usesFeatureRetroactiveAttribute(Decl *decl) {
7373
[](const InheritedEntry &entry) { return entry.isRetroactive(); });
7474
}
7575

76-
static bool usesFeatureOptionalIsolatedParameters(Decl *decl) {
77-
auto *value = dyn_cast<ValueDecl>(decl);
78-
if (!value)
79-
return false;
80-
81-
auto *paramList = getParameterList(value);
82-
if (!paramList)
83-
return false;
84-
85-
for (auto param : *paramList) {
86-
if (param->isIsolated()) {
87-
auto paramType = param->getInterfaceType();
88-
return !paramType->getOptionalObjectType().isNull();
89-
}
90-
}
91-
92-
return false;
93-
}
94-
9576
static bool usesFeatureAssociatedTypeImplements(Decl *decl) {
9677
return isa<TypeDecl>(decl) && decl->getAttrs().hasAttribute<ImplementsAttr>();
9778
}

stdlib/public/Concurrency/AsyncIteratorProtocol.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,6 @@ extension AsyncIteratorProtocol {
133133
@available(SwiftStdlib 6.0, *)
134134
@inlinable
135135
public mutating func next() async throws(Failure) -> Element? {
136-
#if $OptionalIsolatedParameters
137136
return try await next(isolation: nil)
138-
#else
139-
fatalError("unsupported compiler")
140-
#endif
141137
}
142138
}

stdlib/public/Concurrency/Clock.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ extension Clock {
6868
/// }
6969
@available(SwiftStdlib 5.7, *)
7070
@_alwaysEmitIntoClient
71-
@_allowFeatureSuppression(OptionalIsolatedParameters)
7271
public func measure(
7372
isolation: isolated (any Actor)? = #isolation,
7473
_ work: () async throws -> Void

test/Concurrency/sending_asynciteratornext_typechecker_error.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,7 @@ extension AsyncIteratorProtocol {
5252
@available(SwiftStdlib 6.0, *)
5353
@inlinable
5454
public mutating func next() async throws(Failure) -> sending Element? {
55-
#if $OptionalIsolatedParameters
5655
return try await next(isolation: nil)
57-
#else
58-
fatalError("unsupported compiler")
59-
#endif
6056
}
6157
}
6258

test/Concurrency/sending_conditional_suppression.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ public struct TestInStruct {
206206
// Make sure that we emit compiler(>= 5.3) when emitting the suppressing check
207207
// to make sure we do not fail if we fail to parse sending in the if block.
208208

209-
// CHECK-LABEL: #if compiler(>=5.3) && $OptionalIsolatedParameters // Suppression Count: 24
210209
// CHECK-NEXT: #if compiler(>=5.3) && $SendingArgsAndResults // Suppression Count: 25
211210
// CHECK-NEXT: @inlinable public func withCheckedContinuation<T>(isolation: isolated (any _Concurrency.Actor)? = #isolation, function: Swift.String = #function, _ body: (_Concurrency.CheckedContinuation<T, Swift.Never>) -> Swift.Void) async -> sending T {
212211
// CHECK-NEXT: fatalError()
@@ -216,7 +215,6 @@ public struct TestInStruct {
216215
// CHECK-NEXT: fatalError()
217216
// CHECK-NEXT: }
218217
// CHECK-NEXT: #endif
219-
// CHECK-NEXT: #endif
220218
@inlinable public func withCheckedContinuation<T>(
221219
isolation: isolated (any _Concurrency.Actor)? = #isolation,
222220
function: String = #function,

0 commit comments

Comments
 (0)