@@ -4821,8 +4821,6 @@ bool ActorIsolationChecker::mayExecuteConcurrentlyWith(
4821
4821
if (useContext == defContext)
4822
4822
return false ;
4823
4823
4824
- bool isolatedStateMayEscape = false ;
4825
-
4826
4824
auto useIsolation = getActorIsolationOfContext (
4827
4825
const_cast <DeclContext *>(useContext), getClosureActorIsolation);
4828
4826
if (useIsolation.isActorIsolated ()) {
@@ -4840,16 +4838,6 @@ bool ActorIsolationChecker::mayExecuteConcurrentlyWith(
4840
4838
if (ctx.LangOpts .hasFeature (Feature::GlobalActorIsolatedTypesUsability) &&
4841
4839
regionIsolationEnabled && useIsolation.isGlobalActor ())
4842
4840
return false ;
4843
-
4844
- // If the local function is not Sendable, its isolation differs
4845
- // from that of the context, and both contexts are actor isolated,
4846
- // then capturing non-Sendable values allows the closure to stash
4847
- // those values into actor-isolated state. The original context
4848
- // may also stash those values into isolated state, enabling concurrent
4849
- // access later on.
4850
- isolatedStateMayEscape =
4851
- (!regionIsolationEnabled &&
4852
- useIsolation.isActorIsolated () && defIsolation.isActorIsolated ());
4853
4841
}
4854
4842
4855
4843
// Walk the context chain from the use to the definition.
@@ -4859,18 +4847,13 @@ bool ActorIsolationChecker::mayExecuteConcurrentlyWith(
4859
4847
if (closure->isSendable ())
4860
4848
return true ;
4861
4849
4862
- if (isolatedStateMayEscape)
4863
- return true ;
4864
4850
}
4865
4851
4866
4852
if (auto func = dyn_cast<FuncDecl>(useContext)) {
4867
4853
if (func->isLocalCapture ()) {
4868
4854
// If the function is @Sendable... it can be run concurrently.
4869
4855
if (func->isSendable ())
4870
4856
return true ;
4871
-
4872
- if (isolatedStateMayEscape)
4873
- return true ;
4874
4857
}
4875
4858
}
4876
4859
0 commit comments