@@ -676,7 +676,6 @@ ActorIsolationRestriction ActorIsolationRestriction::forDeclaration(
676
676
}
677
677
678
678
case ActorIsolation::Independent:
679
- case ActorIsolation::IndependentUnsafe:
680
679
// Actor-independent have no restrictions on their access.
681
680
return forUnrestricted ();
682
681
@@ -1557,7 +1556,6 @@ namespace {
1557
1556
switch (auto isolation = getActorIsolationOfContext (dc)) {
1558
1557
case ActorIsolation::ActorInstance:
1559
1558
case ActorIsolation::Independent:
1560
- case ActorIsolation::IndependentUnsafe:
1561
1559
case ActorIsolation::Unspecified:
1562
1560
return isolation;
1563
1561
@@ -1733,10 +1731,6 @@ namespace {
1733
1731
return true ;
1734
1732
}
1735
1733
1736
- case ActorIsolation::IndependentUnsafe:
1737
- // Allow unrestricted use of something in a global actor.
1738
- return false ;
1739
-
1740
1734
case ActorIsolation::Independent: {
1741
1735
auto result = tryMarkImplicitlyAsync (loc, valueRef, context);
1742
1736
if (result == AsyncMarkingResult::FoundAsync)
@@ -2107,7 +2101,6 @@ namespace {
2107
2101
2108
2102
return false ;
2109
2103
2110
- case ActorIsolation::IndependentUnsafe:
2111
2104
case ActorIsolation::Unspecified:
2112
2105
return false ;
2113
2106
@@ -2220,7 +2213,6 @@ namespace {
2220
2213
// We must have parent isolation determined to get here.
2221
2214
switch (parentIsolation) {
2222
2215
case ActorIsolation::Independent:
2223
- case ActorIsolation::IndependentUnsafe:
2224
2216
case ActorIsolation::Unspecified:
2225
2217
return ClosureActorIsolation::forIndependent ();
2226
2218
@@ -2372,13 +2364,13 @@ static Optional<ActorIsolation> getIsolationFromAttributes(
2372
2364
// If the declaration is explicitly marked 'nonisolated', report it as
2373
2365
// independent.
2374
2366
if (nonisolatedAttr) {
2375
- return ActorIsolation::forIndependent (ActorIndependentKind::Safe );
2367
+ return ActorIsolation::forIndependent ();
2376
2368
}
2377
2369
2378
2370
// If the declaration is explicitly marked @actorIndependent, report it as
2379
2371
// independent.
2380
2372
if (independentAttr) {
2381
- return ActorIsolation::forIndependent (independentAttr-> getKind () );
2373
+ return ActorIsolation::forIndependent ();
2382
2374
}
2383
2375
2384
2376
// If the declaration is marked with a global actor, report it as being
@@ -2446,7 +2438,6 @@ static Optional<ActorIsolation> getIsolationFromWitnessedRequirements(
2446
2438
case ActorIsolation::GlobalActor:
2447
2439
case ActorIsolation::GlobalActorUnsafe:
2448
2440
case ActorIsolation::Independent:
2449
- case ActorIsolation::IndependentUnsafe:
2450
2441
break ;
2451
2442
}
2452
2443
@@ -2471,7 +2462,6 @@ static Optional<ActorIsolation> getIsolationFromWitnessedRequirements(
2471
2462
llvm_unreachable (" protocol requirements cannot be actor instances" );
2472
2463
2473
2464
case ActorIsolation::Independent:
2474
- case ActorIsolation::IndependentUnsafe:
2475
2465
// We only need one @actorIndependent.
2476
2466
if (sawActorIndependent)
2477
2467
return true ;
@@ -2533,8 +2523,7 @@ ActorIsolation ActorIsolationRequest::evaluate(
2533
2523
// A @Sendable function is assumed to be actor-independent.
2534
2524
if (auto func = dyn_cast<AbstractFunctionDecl>(value)) {
2535
2525
if (func->isSendable ()) {
2536
- defaultIsolation = ActorIsolation::forIndependent (
2537
- ActorIndependentKind::Safe);
2526
+ defaultIsolation = ActorIsolation::forIndependent ();
2538
2527
}
2539
2528
}
2540
2529
@@ -2553,8 +2542,6 @@ ActorIsolation ActorIsolationRequest::evaluate(
2553
2542
// inferred, so that (e.g.) it will be printed and serialized.
2554
2543
ASTContext &ctx = value->getASTContext ();
2555
2544
switch (inferred) {
2556
- // FIXME: if the context is 'unsafe', is it fine to infer the 'safe' one?
2557
- case ActorIsolation::IndependentUnsafe:
2558
2545
case ActorIsolation::Independent:
2559
2546
value->getAttrs ().add (new (ctx) ActorIndependentAttr (
2560
2547
ActorIndependentKind::Safe, /* IsImplicit=*/ true ));
@@ -2727,12 +2714,6 @@ void swift::checkOverrideActorIsolation(ValueDecl *value) {
2727
2714
if (isolation == overriddenIsolation)
2728
2715
return ;
2729
2716
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
-
2736
2717
// If the overridden declaration is from Objective-C with no actor annotation,
2737
2718
// and the overriding declaration has been placed in a global actor, allow it.
2738
2719
if (overridden->hasClangNode () && !overriddenIsolation &&
@@ -2744,7 +2725,6 @@ void swift::checkOverrideActorIsolation(ValueDecl *value) {
2744
2725
if (overriddenIsolation == ActorIsolation::GlobalActorUnsafe) {
2745
2726
switch (isolation) {
2746
2727
case ActorIsolation::Independent:
2747
- case ActorIsolation::IndependentUnsafe:
2748
2728
case ActorIsolation::Unspecified:
2749
2729
return ;
2750
2730
@@ -2773,7 +2753,6 @@ void swift::checkOverrideActorIsolation(ValueDecl *value) {
2773
2753
2774
2754
case ActorIsolation::ActorInstance:
2775
2755
case ActorIsolation::Independent:
2776
- case ActorIsolation::IndependentUnsafe:
2777
2756
// Diagnose below.
2778
2757
break ;
2779
2758
0 commit comments