Skip to content

Make IsolatedDeinit non-experimental #77364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -5959,9 +5959,6 @@ ERROR(isolated_deinit_no_isolation,none,
ERROR(isolated_deinit_on_value_type,none,
"only classes and actors can have isolated deinit",
())
ERROR(isolated_deinit_experimental,none,
"'isolated' deinit requires frontend flag -enable-experimental-feature IsolatedDeinit "
"to enable the usage of this language feature", ())

//------------------------------------------------------------------------------
// MARK: String Processing
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Basic/Features.def
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ EXPERIMENTAL_FEATURE(SafeInterop, true)
EXPERIMENTAL_FEATURE(AssumeResilientCxxTypes, true)

// Isolated deinit
SUPPRESSIBLE_EXPERIMENTAL_FEATURE(IsolatedDeinit, true)
SUPPRESSIBLE_LANGUAGE_FEATURE(IsolatedDeinit, 371, "isolated deinit")

// Enable values in generic signatures, e.g. <let N: Int>
EXPERIMENTAL_FEATURE(ValueGenerics, true)
Expand Down
7 changes: 0 additions & 7 deletions lib/Sema/TypeCheckAttr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,7 @@ class AttributeChecker : public AttributeVisitor<AttributeChecker> {
}

void diagnoseIsolatedDeinitInValueTypes(DeclAttribute *attr) {
auto &C = D->getASTContext();

if (isa<DestructorDecl>(D)) {
if (!C.LangOpts.hasFeature(Feature::IsolatedDeinit)) {
diagnoseAndRemoveAttr(attr, diag::isolated_deinit_experimental);
return;
}

if (auto nominal = dyn_cast<NominalTypeDecl>(D->getDeclContext())) {
if (!isa<ClassDecl>(nominal)) {
// only classes and actors can have isolated deinit.
Expand Down
3 changes: 1 addition & 2 deletions test/Concurrency/Runtime/actor_deinit_escaping_self.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// RUN: %target-run-simple-swift( -enable-experimental-feature IsolatedDeinit -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library)
// RUN: %target-run-simple-swift( -target %target-swift-5.1-abi-triple %import-libdispatch -parse-as-library)

// REQUIRES: executable_test
// REQUIRES: libdispatch
// REQUIRES: concurrency
// REQUIRES: concurrency_runtime
// REQUIRES: swift_feature_IsolatedDeinit
// UNSUPPORTED: back_deployment_runtime

import _Concurrency
Expand Down
3 changes: 1 addition & 2 deletions test/Concurrency/Runtime/actor_recursive_deinit.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// RUN: %target-run-simple-swift(-enable-experimental-feature IsolatedDeinit -target %target-swift-5.1-abi-triple -parse-stdlib -parse-as-library) | %FileCheck %s
// RUN: %target-run-simple-swift(-target %target-swift-5.1-abi-triple -parse-stdlib -parse-as-library) | %FileCheck %s

// REQUIRES: executable_test
// REQUIRES: concurrency

// REQUIRES: concurrency_runtime
// REQUIRES: swift_feature_IsolatedDeinit
// UNSUPPORTED: back_deployment_runtime

// Compiler crashes because builtin "ifdef_SWIFT_STDLIB_PRINT_DISABLED"() gets lowered as "i32 0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -enable-experimental-feature IsolatedDeinit -plugin-path %swift-plugin-dir -enable-experimental-feature IsolatedDeinit -target %target-swift-5.1-abi-triple -parse-stdlib %import-libdispatch %s -o %t/a.out
// RUN: %target-build-swift -plugin-path %swift-plugin-dir -target %target-swift-5.1-abi-triple -parse-stdlib %import-libdispatch %s -o %t/a.out
// RUN: %target-codesign %t/a.out
// RUN: %env-SWIFT_IS_CURRENT_EXECUTOR_LEGACY_MODE_OVERRIDE=swift6 %target-run %t/a.out

Expand Down
3 changes: 1 addition & 2 deletions test/Concurrency/Runtime/isolated_deinit_main_sync.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// RUN: %target-run-simple-swift(-enable-experimental-feature IsolatedDeinit -target %target-swift-5.1-abi-triple) | %FileCheck %s
// RUN: %target-run-simple-swift(-target %target-swift-5.1-abi-triple) | %FileCheck %s

// REQUIRES: executable_test
// REQUIRES: concurrency
// REQUIRES: concurrency_runtime
// REQUIRES: swift_feature_IsolatedDeinit

var isDead: Bool = false

Expand Down
7 changes: 3 additions & 4 deletions test/Concurrency/deinit_isolation.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple -parse-as-library -enable-experimental-feature IsolatedDeinit -emit-silgen -verify %s
// RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple -parse-as-library -enable-experimental-feature IsolatedDeinit -emit-silgen -DSILGEN %s | %FileCheck %s
// RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple -parse-as-library -enable-experimental-feature IsolatedDeinit -emit-silgen -DSILGEN %s | %FileCheck -check-prefix=CHECK-SYMB %s
// RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple -parse-as-library -emit-silgen -verify %s
// RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple -parse-as-library -emit-silgen -DSILGEN %s | %FileCheck %s
// RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple -parse-as-library -emit-silgen -DSILGEN %s | %FileCheck -check-prefix=CHECK-SYMB %s

// REQUIRES: concurrency
// REQUIRES: swift_feature_IsolatedDeinit

// Fixtures

Expand Down
9 changes: 4 additions & 5 deletions test/Concurrency/deinit_isolation_import/test.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@
// RUN: cp -R $INPUT_DIR/Alpha.framework %t/Frameworks/
// RUN: %empty-directory(%t/Frameworks/Alpha.framework/Modules/Alpha.swiftmodule)
// RUN: %empty-directory(%t/Frameworks/Alpha.framework/Headers/)
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-experimental-feature IsolatedDeinit -disable-implicit-string-processing-module-import -parse-as-library -module-name Alpha \
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-implicit-string-processing-module-import -parse-as-library -module-name Alpha \
// RUN: -emit-module -o %t/Frameworks/Alpha.framework/Modules/Alpha.swiftmodule/%module-target-triple.swiftmodule \
// RUN: -enable-objc-interop -disable-objc-attr-requires-foundation-module \
// RUN: -emit-objc-header -emit-objc-header-path %t/Frameworks/Alpha.framework/Headers/Alpha-Swift.h $INPUT_DIR/Alpha.swift
// RUN: cp -R $INPUT_DIR/Beta.framework %t/Frameworks/
// RUN: %empty-directory(%t/Frameworks/Beta.framework/Headers/)
// RUN: cp $INPUT_DIR/Beta.h %t/Frameworks/Beta.framework/Headers/Beta.h
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-experimental-feature IsolatedDeinit -disable-implicit-string-processing-module-import -disable-availability-checking -typecheck -verify %s -F %t/Frameworks -F %clang-importer-sdk-path/frameworks
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-experimental-feature IsolatedDeinit -disable-implicit-string-processing-module-import -disable-availability-checking -parse-as-library -emit-silgen -DSILGEN %s -F %t/Frameworks -F %clang-importer-sdk-path/frameworks | %FileCheck %s
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-experimental-feature IsolatedDeinit -disable-implicit-string-processing-module-import -disable-availability-checking -parse-as-library -emit-silgen -DSILGEN %s -F %t/Frameworks -F %clang-importer-sdk-path/frameworks | %FileCheck -check-prefix=CHECK-SYMB %s
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-implicit-string-processing-module-import -disable-availability-checking -typecheck -verify %s -F %t/Frameworks -F %clang-importer-sdk-path/frameworks
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-implicit-string-processing-module-import -disable-availability-checking -parse-as-library -emit-silgen -DSILGEN %s -F %t/Frameworks -F %clang-importer-sdk-path/frameworks | %FileCheck %s
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-implicit-string-processing-module-import -disable-availability-checking -parse-as-library -emit-silgen -DSILGEN %s -F %t/Frameworks -F %clang-importer-sdk-path/frameworks | %FileCheck -check-prefix=CHECK-SYMB %s

// REQUIRES: concurrency
// REQUIRES: objc_interop
// REQUIRES: swift_feature_IsolatedDeinit

// Note: intentionally importing Alpha implicitly
import Beta
Expand Down
3 changes: 1 addition & 2 deletions test/Concurrency/deinit_isolation_in_value_types.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple -enable-experimental-feature IsolatedDeinit -parse-as-library -emit-silgen -verify %s
// RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple -parse-as-library -emit-silgen -verify %s

// REQUIRES: swift_feature_IsolatedDeinit

@globalActor final actor FirstActor {
static let shared = FirstActor()
Expand Down
7 changes: 3 additions & 4 deletions test/Concurrency/deinit_isolation_objc.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-experimental-feature IsolatedDeinit -disable-implicit-string-processing-module-import -target %target-swift-5.1-abi-triple -parse-as-library -emit-silgen -verify %s
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-experimental-feature IsolatedDeinit -disable-implicit-string-processing-module-import -target %target-swift-5.1-abi-triple -parse-as-library -emit-silgen -DSILGEN %s | %FileCheck %s
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-experimental-feature IsolatedDeinit -disable-implicit-string-processing-module-import -target %target-swift-5.1-abi-triple -parse-as-library -emit-silgen -DSILGEN %s | %FileCheck -check-prefix=CHECK-SYMB %s
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-implicit-string-processing-module-import -target %target-swift-5.1-abi-triple -parse-as-library -emit-silgen -verify %s
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-implicit-string-processing-module-import -target %target-swift-5.1-abi-triple -parse-as-library -emit-silgen -DSILGEN %s | %FileCheck %s
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-implicit-string-processing-module-import -target %target-swift-5.1-abi-triple -parse-as-library -emit-silgen -DSILGEN %s | %FileCheck -check-prefix=CHECK-SYMB %s

// REQUIRES: concurrency
// REQUIRES: objc_interop
// REQUIRES: swift_feature_IsolatedDeinit

import Foundation

Expand Down
3 changes: 1 addition & 2 deletions test/Concurrency/deinit_isolation_tbd.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-experimental-feature IsolatedDeinit -emit-ir %s | %FileCheck %s
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-ir %s | %FileCheck %s

// REQUIRES: swift_feature_IsolatedDeinit

public class Foo {
@MainActor
Expand Down
5 changes: 2 additions & 3 deletions test/Concurrency/flow_isolation.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// RUN: %target-swift-frontend -enable-experimental-feature IsolatedDeinit -strict-concurrency=complete -swift-version 5 -parse-as-library -emit-sil -verify %s
// RUN: %target-swift-frontend -enable-experimental-feature IsolatedDeinit -strict-concurrency=complete -swift-version 5 -parse-as-library -emit-sil -verify %s -enable-upcoming-feature RegionBasedIsolation
// RUN: %target-swift-frontend -strict-concurrency=complete -swift-version 5 -parse-as-library -emit-sil -verify %s
// RUN: %target-swift-frontend -strict-concurrency=complete -swift-version 5 -parse-as-library -emit-sil -verify %s -enable-upcoming-feature RegionBasedIsolation

// REQUIRES: swift_feature_RegionBasedIsolation
// REQUIRES: swift_feature_IsolatedDeinit

func randomBool() -> Bool { return false }
func logTransaction(_ i: Int) {}
Expand Down
3 changes: 1 addition & 2 deletions test/Concurrency/voucher_propagation.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -target %target-swift-5.1-abi-triple -enable-experimental-feature IsolatedDeinit -o %t/voucher_propagation
// RUN: %target-build-swift %s -target %target-swift-5.1-abi-triple -o %t/voucher_propagation
// RUN: %target-codesign %t/voucher_propagation
// RUN: MallocStackLogging=1 %target-run %t/voucher_propagation

Expand All @@ -13,7 +13,6 @@
// UNSUPPORTED: back_deployment_runtime

// REQUIRES: OS=macosx
// REQUIRES: swift_feature_IsolatedDeinit

import Darwin
import Dispatch // expected-warning {{add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'Dispatch'}}
Expand Down
3 changes: 1 addition & 2 deletions test/Distributed/Runtime/distributed_actor_deinit.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -target %target-swift-5.7-abi-triple %import-libdispatch -enable-experimental-feature IsolatedDeinit -parse-stdlib -parse-as-library -module-name=main %s -o %t/a.out
// RUN: %target-build-swift -target %target-swift-5.7-abi-triple %import-libdispatch -parse-stdlib -parse-as-library -module-name=main %s -o %t/a.out
// RUN: %target-codesign %t/a.out
// RUN: %env-SWIFT_IS_CURRENT_EXECUTOR_LEGACY_MODE_OVERRIDE=legacy %target-run %t/a.out | %FileCheck %s

// REQUIRES: libdispatch
// REQUIRES: executable_test
// REQUIRES: concurrency
// REQUIRES: distributed
// REQUIRES: swift_feature_IsolatedDeinit

// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: back_deployment_runtime
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend-emit-module -enable-experimental-feature IsolatedDeinit -emit-module-path %t/FakeDistributedActorSystems.swiftmodule -module-name FakeDistributedActorSystems -target %target-swift-5.7-abi-triple %S/../Inputs/FakeDistributedActorSystems.swift
// RUN: %target-build-swift -module-name main -enable-experimental-feature IsolatedDeinit -target %target-swift-5.7-abi-triple -j2 -parse-as-library -I %t %s %S/../Inputs/FakeDistributedActorSystems.swift -o %t/a.out
// RUN: %target-swift-frontend-emit-module -emit-module-path %t/FakeDistributedActorSystems.swiftmodule -module-name FakeDistributedActorSystems -target %target-swift-5.7-abi-triple %S/../Inputs/FakeDistributedActorSystems.swift
// RUN: %target-build-swift -module-name main -target %target-swift-5.7-abi-triple -j2 -parse-as-library -I %t %s %S/../Inputs/FakeDistributedActorSystems.swift -o %t/a.out
// RUN: %target-codesign %t/a.out
// RUN: %target-run %t/a.out | %FileCheck %s

// REQUIRES: executable_test
// REQUIRES: concurrency
// REQUIRES: distributed
// REQUIRES: swift_feature_IsolatedDeinit

// rdar://76038845
// UNSUPPORTED: use_os_stdlib
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// RUN: %target-run-simple-swift( -enable-experimental-feature IsolatedDeinit -target %target-swift-5.7-abi-triple -parse-as-library) | %FileCheck %s
// RUN: %target-run-simple-swift( -target %target-swift-5.7-abi-triple -parse-as-library) | %FileCheck %s

// REQUIRES: executable_test
// REQUIRES: concurrency
// REQUIRES: distributed
// REQUIRES: swift_feature_IsolatedDeinit

// rdar://76038845
// UNSUPPORTED: use_os_stdlib
Expand Down
7 changes: 3 additions & 4 deletions test/ModuleInterface/isolated-deinit-compatibility.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// RUN: %target-swift-frontend -enable-experimental-feature IsolatedDeinit -target %target-swift-5.5-abi-triple -emit-silgen -verify %s
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) -DEMIT_IFACE %s -enable-experimental-feature IsolatedDeinit -target %target-swift-5.5-abi-triple -module-name IsolatedDeinitCompatibility
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -enable-experimental-feature IsolatedDeinit -target %target-swift-5.5-abi-triple -module-name IsolatedDeinitCompatibility
// RUN: %target-swift-frontend -target %target-swift-5.5-abi-triple -emit-silgen -verify %s
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) -DEMIT_IFACE %s -target %target-swift-5.5-abi-triple -module-name IsolatedDeinitCompatibility
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -target %target-swift-5.5-abi-triple -module-name IsolatedDeinitCompatibility
// RUN: %FileCheck %s < %t.swiftinterface

// REQUIRES: swift_feature_IsolatedDeinit

// MARK: Sync deinit in class

Expand Down
3 changes: 1 addition & 2 deletions test/SILGen/inlinable_attribute.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// RUN: %target-swift-emit-silgen -enable-experimental-feature IsolatedDeinit -module-name inlinable_attribute -emit-verbose-sil -warnings-as-errors -target %target-swift-5.1-abi-triple %s | %FileCheck %s
// RUN: %target-swift-emit-silgen -module-name inlinable_attribute -emit-verbose-sil -warnings-as-errors -target %target-swift-5.1-abi-triple %s | %FileCheck %s

// REQUIRES: swift_feature_IsolatedDeinit

// CHECK-LABEL: sil [serialized] [ossa] @$s19inlinable_attribute15fragileFunctionyyF : $@convention(thin) () -> ()
@inlinable public func fragileFunction() {
Expand Down
2 changes: 1 addition & 1 deletion test/SILOptimizer/stack_promotion_isolated_deinit.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-swift-frontend -parse-as-library -O -module-name=test %s -emit-sil -enable-experimental-feature IsolatedDeinit | %FileCheck %s
// RUN: %target-swift-frontend -parse-as-library -O -module-name=test %s -emit-sil | %FileCheck %s
// REQUIRES: swift_in_compiler
// REQUIRES: swift_feature_IsolatedDeinit

Expand Down
3 changes: 1 addition & 2 deletions test/attr/global_actor.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// RUN: %target-swift-frontend -typecheck -verify %s -disable-availability-checking -package-name myPkg -enable-experimental-feature IsolatedDeinit
// RUN: %target-swift-frontend -typecheck -verify %s -disable-availability-checking -package-name myPkg
// REQUIRES: concurrency
// REQUIRES: swift_feature_IsolatedDeinit

actor SomeActor { }

Expand Down