Skip to content

Commit 966269d

Browse files
committed
[Features] Promote IsolatedAny and its alias to a language feature.
The proposal is accepted and implemented for Swift 6.0.
1 parent 9c868f8 commit 966269d

16 files changed

+16
-32
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5664,8 +5664,6 @@ ERROR(isolated_parameter_combined_nonisolated,none,
56645664
ERROR(isolated_parameter_isolated_attr_type,none,
56655665
"function with 'isolated' parameter cannot also be '@isolated(%0)'",
56665666
(StringRef))
5667-
ERROR(isolated_any_experimental,none,
5668-
"attribute requires '-enable-experimental-feature IsolatedAny'", ())
56695667
ERROR(isolated_attr_global_actor_type,none,
56705668
"function type cannot have both a global actor and '@isolated(%0)'",
56715669
(StringRef))

include/swift/Basic/Features.def

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ LANGUAGE_FEATURE(BodyMacros, 415, "Function body macros")
199199
LANGUAGE_FEATURE(TransferringArgsAndResults, 430, "Transferring args and results")
200200
SUPPRESSIBLE_LANGUAGE_FEATURE(SendingArgsAndResults, 430, "Sending arg and results")
201201
LANGUAGE_FEATURE(BorrowingSwitch, 432, "Noncopyable type pattern matching")
202+
CONDITIONALLY_SUPPRESSIBLE_LANGUAGE_FEATURE(IsolatedAny, 431, "@isolated(any) function types")
203+
LANGUAGE_FEATURE(IsolatedAny2, 431, "@isolated(any) function types")
202204

203205
// Swift 6
204206
UPCOMING_FEATURE(ConciseMagicFile, 274, 6)
@@ -373,15 +375,9 @@ EXPERIMENTAL_FEATURE(GroupActorErrors, true)
373375
// Enable explicit isolation of closures.
374376
EXPERIMENTAL_FEATURE(ClosureIsolation, true)
375377

376-
// Enable isolated(any) attribute on function types.
377-
CONDITIONALLY_SUPPRESSIBLE_EXPERIMENTAL_FEATURE(IsolatedAny, true)
378-
379378
// Whether lookup of members respects the enclosing file's imports.
380379
EXPERIMENTAL_FEATURE_EXCLUDED_FROM_MODULE_INTERFACE(MemberImportVisibility, true)
381380

382-
// Alias for IsolatedAny
383-
EXPERIMENTAL_FEATURE(IsolatedAny2, true)
384-
385381
// Enable @implementation on extensions of ObjC classes.
386382
EXPERIMENTAL_FEATURE(ObjCImplementation, true)
387383

lib/Sema/TypeCheckType.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3926,11 +3926,6 @@ NeverNullType TypeResolver::resolveASTFunctionType(
39263926
if (isolatedAttr && !isolatedAttr->isInvalid()) {
39273927
switch (isolatedAttr->getIsolationKind()) {
39283928
case IsolatedTypeAttr::IsolationKind::Dynamic:
3929-
if (!getASTContext().LangOpts.hasFeature(Feature::IsolatedAny)) {
3930-
diagnose(isolatedAttr->getAtLoc(), diag::isolated_any_experimental);
3931-
// Proceed as normal.
3932-
}
3933-
39343929
if (representation != FunctionType::Representation::Swift) {
39353930
assert(conventionAttr);
39363931
diagnoseInvalid(repr, isolatedAttr->getAtLoc(),

stdlib/public/Concurrency/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ else()
6060
list(APPEND SWIFT_RUNTIME_CONCURRENCY_C_FLAGS "-fswift-async-fp=never")
6161
endif()
6262

63-
list(APPEND SWIFT_RUNTIME_CONCURRENCY_SWIFT_FLAGS
64-
"-enable-experimental-feature"
65-
"IsolatedAny2"
66-
)
67-
6863
list(APPEND SWIFT_RUNTIME_CONCURRENCY_C_FLAGS
6964
"-D__STDC_WANT_LIB_EXT1__=1")
7065

test/Concurrency/isolated_any.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -typecheck -verify -disable-availability-checking -strict-concurrency=complete -enable-experimental-feature IsolatedAny -enable-upcoming-feature InferSendableFromCaptures %s
1+
// RUN: %target-swift-frontend -typecheck -verify -disable-availability-checking -strict-concurrency=complete -enable-upcoming-feature InferSendableFromCaptures %s
22

33
// REQUIRES: asserts
44

test/Distributed/distributed_actor_isolated_any.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend-emit-module -emit-module-path %t/FakeDistributedActorSystems.swiftmodule -module-name FakeDistributedActorSystems -disable-availability-checking %S/Inputs/FakeDistributedActorSystems.swift
33

4-
// RUN: %target-swift-frontend -emit-silgen -enable-experimental-feature IsolatedAny %s -module-name test -swift-version 5 -disable-availability-checking -I %t | %FileCheck %s
4+
// RUN: %target-swift-frontend -emit-silgen %s -module-name test -swift-version 5 -disable-availability-checking -I %t | %FileCheck %s
55

66
// REQUIRES: concurrency
77
// REQUIRES: asserts

test/IRGen/isolated_any.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -emit-ir %s -enable-experimental-feature IsolatedAny | %IRGenFileCheck %s
1+
// RUN: %target-swift-frontend -emit-ir %s | %IRGenFileCheck %s
22

33
// REQUIRES: concurrency
44

test/IRGen/isolated_any_metadata.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %swift -emit-ir %s -enable-experimental-feature IsolatedAny -target x86_64-apple-macosx10.10 -disable-legacy-type-info -parse-stdlib | %FileCheck -DINT=i64 %s -check-prefixes=CHECK,CHECK-ACCESSOR
2-
// RUN: %swift -emit-ir %s -enable-experimental-feature IsolatedAny -target x86_64-unknown-linux-gnu -disable-legacy-type-info -parse-stdlib | %FileCheck -DINT=i64 %s -check-prefixes=CHECK,CHECK-DEMANGLE
1+
// RUN: %swift -emit-ir %s -target x86_64-apple-macosx10.10 -disable-legacy-type-info -parse-stdlib | %FileCheck -DINT=i64 %s -check-prefixes=CHECK,CHECK-ACCESSOR
2+
// RUN: %swift -emit-ir %s -target x86_64-unknown-linux-gnu -disable-legacy-type-info -parse-stdlib | %FileCheck -DINT=i64 %s -check-prefixes=CHECK,CHECK-DEMANGLE
33

44
// REQUIRES: concurrency
55

test/ModuleInterface/isolated_any_suppression.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %empty-directory(%t)
22

3-
// RUN: %target-swift-frontend -swift-version 5 -enable-library-evolution -module-name isolated_any -emit-module -o %t/isolated_any.swiftmodule -emit-module-interface-path - -enable-experimental-feature IsolatedAny %s | %FileCheck %s
4-
// RUN: %target-swift-frontend -swift-version 5 -enable-library-evolution -module-name isolated_any -emit-module -o %t/isolated_any.swiftmodule -emit-module-interface-path - -enable-experimental-feature IsolatedAny2 %s | %FileCheck %s
3+
// RUN: %target-swift-frontend -swift-version 5 -enable-library-evolution -module-name isolated_any -emit-module -o %t/isolated_any.swiftmodule -emit-module-interface-path - %s | %FileCheck %s
4+
// RUN: %target-swift-frontend -swift-version 5 -enable-library-evolution -module-name isolated_any -emit-module -o %t/isolated_any.swiftmodule -emit-module-interface-path - %s | %FileCheck %s
55

66
// CHECK: #if compiler(>=5.3) && $IsolatedAny
77
// CHECK-NEXT: {{^}}public func test1(fn: @isolated(any) @Sendable () -> ())

test/Parse/isolated_any.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -enable-experimental-feature IsolatedAny -disable-availability-checking
1+
// RUN: %target-typecheck-verify-swift -disable-availability-checking
22

33
// REQUIRES: asserts
44

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// RUN: %target-typecheck-verify-swift
22

3-
typealias FnType = @isolated(any) () -> () // expected-error {{attribute requires '-enable-experimental-feature IsolatedAny'}}
3+
typealias FnType = @isolated(any) () -> ()

test/SILGen/isolated_any.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -emit-silgen -enable-experimental-feature IsolatedAny %s -module-name test -swift-version 6 -disable-availability-checking | %FileCheck %s
1+
// RUN: %target-swift-frontend -emit-silgen %s -module-name test -swift-version 6 -disable-availability-checking | %FileCheck %s
22
// REQUIRES: concurrency
33
// REQUIRES: asserts
44

test/SILGen/isolated_any_conformance.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -emit-silgen -enable-experimental-feature IsolatedAny %s -module-name test -swift-version 6 -disable-availability-checking | %FileCheck %s
1+
// RUN: %target-swift-frontend -emit-silgen %s -module-name test -swift-version 6 -disable-availability-checking | %FileCheck %s
22
// REQUIRES: concurrency
33
// REQUIRES: asserts
44

test/SILGen/isolated_any_invalid.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -emit-silgen -enable-experimental-feature IsolatedAny %s -module-name test -swift-version 6 -disable-availability-checking -verify
1+
// RUN: %target-swift-frontend -emit-silgen %s -module-name test -swift-version 6 -disable-availability-checking -verify
22
// REQUIRES: concurrency
33

44
func takeSyncIsolatedAny(fn: @escaping @isolated(any) () -> ()) {}

test/Sema/availability_isolated_any.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -target %target-cpu-apple-macosx10.50 -enable-experimental-feature IsolatedAny
1+
// RUN: %target-typecheck-verify-swift -target %target-cpu-apple-macosx10.50
22

33
// REQUIRES: OS=macosx
44

test/decl/protocol/conforms/isolated_any.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -typecheck -enable-experimental-feature IsolatedAny -verify %s
1+
// RUN: %target-swift-frontend -typecheck -verify %s
22

33
struct A<T> {
44
// expected-note @+1 {{candidate has non-matching type}}

0 commit comments

Comments
 (0)