@@ -676,7 +676,6 @@ ActorIsolationRestriction ActorIsolationRestriction::forDeclaration(
676676 }
677677
678678 case ActorIsolation::Independent:
679- case ActorIsolation::IndependentUnsafe:
680679 // Actor-independent have no restrictions on their access.
681680 return forUnrestricted ();
682681
@@ -1557,7 +1556,6 @@ namespace {
15571556 switch (auto isolation = getActorIsolationOfContext (dc)) {
15581557 case ActorIsolation::ActorInstance:
15591558 case ActorIsolation::Independent:
1560- case ActorIsolation::IndependentUnsafe:
15611559 case ActorIsolation::Unspecified:
15621560 return isolation;
15631561
@@ -1733,10 +1731,6 @@ namespace {
17331731 return true ;
17341732 }
17351733
1736- case ActorIsolation::IndependentUnsafe:
1737- // Allow unrestricted use of something in a global actor.
1738- return false ;
1739-
17401734 case ActorIsolation::Independent: {
17411735 auto result = tryMarkImplicitlyAsync (loc, valueRef, context);
17421736 if (result == AsyncMarkingResult::FoundAsync)
@@ -2107,7 +2101,6 @@ namespace {
21072101
21082102 return false ;
21092103
2110- case ActorIsolation::IndependentUnsafe:
21112104 case ActorIsolation::Unspecified:
21122105 return false ;
21132106
@@ -2220,7 +2213,6 @@ namespace {
22202213 // We must have parent isolation determined to get here.
22212214 switch (parentIsolation) {
22222215 case ActorIsolation::Independent:
2223- case ActorIsolation::IndependentUnsafe:
22242216 case ActorIsolation::Unspecified:
22252217 return ClosureActorIsolation::forIndependent ();
22262218
@@ -2372,13 +2364,13 @@ static Optional<ActorIsolation> getIsolationFromAttributes(
23722364 // If the declaration is explicitly marked 'nonisolated', report it as
23732365 // independent.
23742366 if (nonisolatedAttr) {
2375- return ActorIsolation::forIndependent (ActorIndependentKind::Safe );
2367+ return ActorIsolation::forIndependent ();
23762368 }
23772369
23782370 // If the declaration is explicitly marked @actorIndependent, report it as
23792371 // independent.
23802372 if (independentAttr) {
2381- return ActorIsolation::forIndependent (independentAttr-> getKind () );
2373+ return ActorIsolation::forIndependent ();
23822374 }
23832375
23842376 // If the declaration is marked with a global actor, report it as being
@@ -2446,7 +2438,6 @@ static Optional<ActorIsolation> getIsolationFromWitnessedRequirements(
24462438 case ActorIsolation::GlobalActor:
24472439 case ActorIsolation::GlobalActorUnsafe:
24482440 case ActorIsolation::Independent:
2449- case ActorIsolation::IndependentUnsafe:
24502441 break ;
24512442 }
24522443
@@ -2471,7 +2462,6 @@ static Optional<ActorIsolation> getIsolationFromWitnessedRequirements(
24712462 llvm_unreachable (" protocol requirements cannot be actor instances" );
24722463
24732464 case ActorIsolation::Independent:
2474- case ActorIsolation::IndependentUnsafe:
24752465 // We only need one @actorIndependent.
24762466 if (sawActorIndependent)
24772467 return true ;
@@ -2533,8 +2523,7 @@ ActorIsolation ActorIsolationRequest::evaluate(
25332523 // A @Sendable function is assumed to be actor-independent.
25342524 if (auto func = dyn_cast<AbstractFunctionDecl>(value)) {
25352525 if (func->isSendable ()) {
2536- defaultIsolation = ActorIsolation::forIndependent (
2537- ActorIndependentKind::Safe);
2526+ defaultIsolation = ActorIsolation::forIndependent ();
25382527 }
25392528 }
25402529
@@ -2553,8 +2542,6 @@ ActorIsolation ActorIsolationRequest::evaluate(
25532542 // inferred, so that (e.g.) it will be printed and serialized.
25542543 ASTContext &ctx = value->getASTContext ();
25552544 switch (inferred) {
2556- // FIXME: if the context is 'unsafe', is it fine to infer the 'safe' one?
2557- case ActorIsolation::IndependentUnsafe:
25582545 case ActorIsolation::Independent:
25592546 value->getAttrs ().add (new (ctx) ActorIndependentAttr (
25602547 ActorIndependentKind::Safe, /* IsImplicit=*/ true ));
@@ -2727,12 +2714,6 @@ void swift::checkOverrideActorIsolation(ValueDecl *value) {
27272714 if (isolation == overriddenIsolation)
27282715 return ;
27292716
2730- // If the overridden declaration is @actorIndependent(unsafe) and the
2731- // overriding declaration has been placed in a global actor, allow it.
2732- if (overriddenIsolation.getKind () == ActorIsolation::IndependentUnsafe &&
2733- isolation.isGlobalActor ())
2734- return ;
2735-
27362717 // If the overridden declaration is from Objective-C with no actor annotation,
27372718 // and the overriding declaration has been placed in a global actor, allow it.
27382719 if (overridden->hasClangNode () && !overriddenIsolation &&
@@ -2744,7 +2725,6 @@ void swift::checkOverrideActorIsolation(ValueDecl *value) {
27442725 if (overriddenIsolation == ActorIsolation::GlobalActorUnsafe) {
27452726 switch (isolation) {
27462727 case ActorIsolation::Independent:
2747- case ActorIsolation::IndependentUnsafe:
27482728 case ActorIsolation::Unspecified:
27492729 return ;
27502730
@@ -2773,7 +2753,6 @@ void swift::checkOverrideActorIsolation(ValueDecl *value) {
27732753
27742754 case ActorIsolation::ActorInstance:
27752755 case ActorIsolation::Independent:
2776- case ActorIsolation::IndependentUnsafe:
27772756 // Diagnose below.
27782757 break ;
27792758
0 commit comments