Skip to content

Commit 13dae34

Browse files
authored
Merge pull request swiftlang#77227 from simanerush/0449-remove-flag
[SE-0449] Remove `GlobalActorInferenceCutoff` feature flag.
2 parents 36f2f46 + 4ee76c5 commit 13dae34

File tree

3 files changed

+6
-22
lines changed

3 files changed

+6
-22
lines changed

include/swift/Basic/Features.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ UPCOMING_FEATURE(RegionBasedIsolation, 414, 6)
219219
UPCOMING_FEATURE(DynamicActorIsolation, 423, 6)
220220
UPCOMING_FEATURE(NonfrozenEnumExhaustivity, 192, 6)
221221
UPCOMING_FEATURE(GlobalActorIsolatedTypesUsability, 0434, 6)
222-
UPCOMING_FEATURE(GlobalActorInferenceCutoff, 0449, 6)
223222

224223
// Swift 7
225224
UPCOMING_FEATURE(ExistentialAny, 335, 7)

lib/AST/FeatureSet.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ UNINTERESTING_FEATURE(FixedArrays)
197197
UNINTERESTING_FEATURE(GroupActorErrors)
198198
UNINTERESTING_FEATURE(SameElementRequirements)
199199
UNINTERESTING_FEATURE(UnspecifiedMeansMainActorIsolated)
200-
UNINTERESTING_FEATURE(GlobalActorInferenceCutoff)
201200
UNINTERESTING_FEATURE(GenerateForceToMainActorThunks)
202201

203202
static bool usesFeatureSendingArgsAndResults(Decl *decl) {

lib/Sema/TypeCheckAttr.cpp

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7153,15 +7153,6 @@ void AttributeChecker::visitNonisolatedAttr(NonisolatedAttr *attr) {
71537153
// 'nonisolated' can be applied to global and static/class variables
71547154
// that do not have storage.
71557155
auto dc = D->getDeclContext();
7156-
auto &ctx = D->getASTContext();
7157-
7158-
if (!ctx.LangOpts.hasFeature(Feature::GlobalActorInferenceCutoff)) {
7159-
if (isa<ProtocolDecl>(D) || isa<ExtensionDecl>(D) || isa<ClassDecl>(D) ||
7160-
isa<StructDecl>(D) || isa<EnumDecl>(D)) {
7161-
diagnoseAndRemoveAttr(attr, diag::invalid_decl_modifier, attr);
7162-
return;
7163-
}
7164-
}
71657156

71667157
// nonisolated(unsafe) is unsafe, but only under strict concurrency.
71677158
if (attr->isUnsafe() &&
@@ -7184,14 +7175,12 @@ void AttributeChecker::visitNonisolatedAttr(NonisolatedAttr *attr) {
71847175
}
71857176
}
71867177

7187-
if (ctx.LangOpts.hasFeature(Feature::GlobalActorInferenceCutoff)) {
71887178
// Additionally, a stored property of a non-'Sendable' type can be
71897179
// explicitly marked 'nonisolated'.
71907180
if (auto parentDecl = dc->getDeclaredTypeInContext())
71917181
if (!parentDecl->isSendableType()) {
71927182
canBeNonisolated = true;
71937183
}
7194-
}
71957184

71967185
// Otherwise, this stored property has to be qualified as 'unsafe'.
71977186
if (var->supportsMutation() && !attr->isUnsafe() && !canBeNonisolated) {
@@ -7203,15 +7192,12 @@ void AttributeChecker::visitNonisolatedAttr(NonisolatedAttr *attr) {
72037192

72047193
// 'nonisolated' without '(unsafe)' is not allowed on non-Sendable
72057194
// variables, unless they are a member of a non-'Sendable' type.
7206-
if (!attr->isUnsafe() && !type->hasError()) {
7207-
if (!(canBeNonisolated &&
7208-
ctx.LangOpts.hasFeature(Feature::GlobalActorInferenceCutoff))) {
7209-
bool diagnosed = diagnoseIfAnyNonSendableTypes(
7210-
type, SendableCheckContext(dc), Type(), SourceLoc(),
7211-
attr->getLocation(), diag::nonisolated_non_sendable);
7212-
if (diagnosed)
7213-
return;
7214-
}
7195+
if (!attr->isUnsafe() && !type->hasError() && !canBeNonisolated) {
7196+
bool diagnosed = diagnoseIfAnyNonSendableTypes(
7197+
type, SendableCheckContext(dc), Type(), SourceLoc(),
7198+
attr->getLocation(), diag::nonisolated_non_sendable);
7199+
if (diagnosed)
7200+
return;
72157201
}
72167202
}
72177203

0 commit comments

Comments
 (0)