Skip to content

Commit 2f5c6d2

Browse files
committed
Collapse experimental feature StrictSendableMetatypes into IsolatedConformances
1 parent 0bd4ee3 commit 2f5c6d2

File tree

7 files changed

+7
-14
lines changed

7 files changed

+7
-14
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8467,9 +8467,6 @@ NOTE(note_isolate_conformance_to_global_actor,none,
84678467
NOTE(note_depends_on_isolated_conformance,none,
84688468
"conformance depends on %0 conformance of %1 to %kind2",
84698469
(ActorIsolation, Type, const ValueDecl *))
8470-
ERROR(nonisolated_conformance_depends_on_isolated_conformance,none,
8471-
"conformance of %0 to %1 depends on %2 conformance of %3 to %4; mark it as '%5'",
8472-
(Type, DeclName, ActorIsolation, Type, DeclName, StringRef))
84738470
ERROR(isolated_conformance_with_sendable,none,
84748471
"%4 conformance of %0 to %1 cannot satisfy conformance "
84758472
"requirement for a %select{`Sendable`|`SendableMetatype`}2 type "

include/swift/Basic/Features.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,6 @@ ADOPTABLE_EXPERIMENTAL_FEATURE(AsyncCallerExecution, false)
488488
/// Allow custom availability domains to be defined and referenced.
489489
SUPPRESSIBLE_EXPERIMENTAL_FEATURE(CustomAvailability, true)
490490

491-
/// Be strict about the Sendable conformance of metatypes.
492-
EXPERIMENTAL_FEATURE(StrictSendableMetatypes, true)
493-
494491
/// Allow public enumerations to be extensible by default
495492
/// regardless of whether the module they are declared in
496493
/// is resilient or not.

lib/AST/ConformanceLookup.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,10 @@ static ProtocolConformanceRef getBuiltinMetaTypeTypeConformance(
387387
if (auto kp = protocol->getKnownProtocolKind()) {
388388
switch (*kp) {
389389
case KnownProtocolKind::Sendable:
390-
// Metatypes are generally Sendable, but under StrictSendableMetatypes we
390+
// Metatypes are generally Sendable, but with isolated conformances we
391391
// cannot assume that metatypes based on type parameters are Sendable.
392392
// Therefore, check for conformance to SendableMetatype.
393-
if (ctx.LangOpts.hasFeature(Feature::StrictSendableMetatypes)) {
393+
if (ctx.LangOpts.hasFeature(Feature::IsolatedConformances)) {
394394
auto sendableMetatypeProto =
395395
ctx.getProtocol(KnownProtocolKind::SendableMetatype);
396396
if (sendableMetatypeProto) {

lib/AST/FeatureSet.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@ UNINTERESTING_FEATURE(NonfrozenEnumExhaustivity)
276276
UNINTERESTING_FEATURE(ClosureIsolation)
277277
UNINTERESTING_FEATURE(Extern)
278278
UNINTERESTING_FEATURE(ConsumeSelfInDeinit)
279-
UNINTERESTING_FEATURE(StrictSendableMetatypes)
280279

281280
static bool usesFeatureBitwiseCopyable2(Decl *decl) {
282281
if (!decl->getModuleContext()->isStdlibModule()) {

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3011,7 +3011,7 @@ namespace {
30113011
// FIXME: When passing to a sending parameter, should this be handled
30123012
// by region isolation? Or should it always be handled by region
30133013
// isolation?
3014-
if (ctx.LangOpts.hasFeature(Feature::StrictSendableMetatypes) &&
3014+
if (ctx.LangOpts.hasFeature(Feature::IsolatedConformances) &&
30153015
(mayExecuteConcurrentlyWith(
30163016
localFunc.getAsDeclContext(), getDeclContext()) ||
30173017
(explicitClosure && explicitClosure->isPassedToSendingParameter()))) {

test/Concurrency/sendable_metatype.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// RUN: %target-typecheck-verify-swift -swift-version 6 -enable-experimental-feature StrictSendableMetatypes -emit-sil -o /dev/null
1+
// RUN: %target-typecheck-verify-swift -swift-version 6 -enable-experimental-feature IsolatedConformances -emit-sil -o /dev/null
22

33
// REQUIRES: concurrency
4-
// REQUIRES: swift_feature_StrictSendableMetatypes
4+
// REQUIRES: swift_feature_IsolatedConformances
55

66

77
protocol Q {

test/Concurrency/sendable_metatype_typecheck.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// RUN: %target-typecheck-verify-swift -swift-version 6 -enable-experimental-feature StrictSendableMetatypes
1+
// RUN: %target-typecheck-verify-swift -swift-version 6 -enable-experimental-feature IsolatedConformances
22

33
// REQUIRES: concurrency
4-
// REQUIRES: swift_feature_StrictSendableMetatypes
4+
// REQUIRES: swift_feature_IsolatedConformances
55

66
// This test checks for typecheck-only diagnostics involving non-sendable
77
// metatypes.

0 commit comments

Comments
 (0)