@@ -4839,8 +4839,6 @@ bool ActorIsolationChecker::mayExecuteConcurrentlyWith(
4839
4839
if (useContext == defContext)
4840
4840
return false ;
4841
4841
4842
- bool isolatedStateMayEscape = false ;
4843
-
4844
4842
auto useIsolation = getActorIsolationOfContext (
4845
4843
const_cast <DeclContext *>(useContext), getClosureActorIsolation);
4846
4844
if (useIsolation.isActorIsolated ()) {
@@ -4858,16 +4856,6 @@ bool ActorIsolationChecker::mayExecuteConcurrentlyWith(
4858
4856
if (ctx.LangOpts .hasFeature (Feature::GlobalActorIsolatedTypesUsability) &&
4859
4857
regionIsolationEnabled && useIsolation.isGlobalActor ())
4860
4858
return false ;
4861
-
4862
- // If the local function is not Sendable, its isolation differs
4863
- // from that of the context, and both contexts are actor isolated,
4864
- // then capturing non-Sendable values allows the closure to stash
4865
- // those values into actor isolated state. The original context
4866
- // may also stash those values into isolated state, enabling concurrent
4867
- // access later on.
4868
- isolatedStateMayEscape =
4869
- (!regionIsolationEnabled &&
4870
- useIsolation.isActorIsolated () && defIsolation.isActorIsolated ());
4871
4859
}
4872
4860
4873
4861
// Walk the context chain from the use to the definition.
@@ -4877,18 +4865,13 @@ bool ActorIsolationChecker::mayExecuteConcurrentlyWith(
4877
4865
if (closure->isSendable ())
4878
4866
return true ;
4879
4867
4880
- if (isolatedStateMayEscape)
4881
- return true ;
4882
4868
}
4883
4869
4884
4870
if (auto func = dyn_cast<FuncDecl>(useContext)) {
4885
4871
if (func->isLocalCapture ()) {
4886
4872
// If the function is @Sendable... it can be run concurrently.
4887
4873
if (func->isSendable ())
4888
4874
return true ;
4889
-
4890
- if (isolatedStateMayEscape)
4891
- return true ;
4892
4875
}
4893
4876
}
4894
4877
0 commit comments