@@ -668,7 +668,6 @@ ActorIsolationRestriction ActorIsolationRestriction::forDeclaration(
668
668
}
669
669
670
670
case ActorIsolation::Independent:
671
- case ActorIsolation::IndependentUnsafe:
672
671
// Actor-independent have no restrictions on their access.
673
672
return forUnrestricted ();
674
673
@@ -1549,7 +1548,6 @@ namespace {
1549
1548
switch (auto isolation = getActorIsolationOfContext (dc)) {
1550
1549
case ActorIsolation::ActorInstance:
1551
1550
case ActorIsolation::Independent:
1552
- case ActorIsolation::IndependentUnsafe:
1553
1551
case ActorIsolation::Unspecified:
1554
1552
return isolation;
1555
1553
@@ -1725,10 +1723,6 @@ namespace {
1725
1723
return true ;
1726
1724
}
1727
1725
1728
- case ActorIsolation::IndependentUnsafe:
1729
- // Allow unrestricted use of something in a global actor.
1730
- return false ;
1731
-
1732
1726
case ActorIsolation::Independent: {
1733
1727
auto result = tryMarkImplicitlyAsync (loc, valueRef, context);
1734
1728
if (result == AsyncMarkingResult::FoundAsync)
@@ -2099,7 +2093,6 @@ namespace {
2099
2093
2100
2094
return false ;
2101
2095
2102
- case ActorIsolation::IndependentUnsafe:
2103
2096
case ActorIsolation::Unspecified:
2104
2097
return false ;
2105
2098
@@ -2212,7 +2205,6 @@ namespace {
2212
2205
// We must have parent isolation determined to get here.
2213
2206
switch (parentIsolation) {
2214
2207
case ActorIsolation::Independent:
2215
- case ActorIsolation::IndependentUnsafe:
2216
2208
case ActorIsolation::Unspecified:
2217
2209
return ClosureActorIsolation::forIndependent ();
2218
2210
@@ -2364,13 +2356,13 @@ static Optional<ActorIsolation> getIsolationFromAttributes(
2364
2356
// If the declaration is explicitly marked 'nonisolated', report it as
2365
2357
// independent.
2366
2358
if (nonisolatedAttr) {
2367
- return ActorIsolation::forIndependent (ActorIndependentKind::Safe );
2359
+ return ActorIsolation::forIndependent ();
2368
2360
}
2369
2361
2370
2362
// If the declaration is explicitly marked @actorIndependent, report it as
2371
2363
// independent.
2372
2364
if (independentAttr) {
2373
- return ActorIsolation::forIndependent (independentAttr-> getKind () );
2365
+ return ActorIsolation::forIndependent ();
2374
2366
}
2375
2367
2376
2368
// If the declaration is marked with a global actor, report it as being
@@ -2438,7 +2430,6 @@ static Optional<ActorIsolation> getIsolationFromWitnessedRequirements(
2438
2430
case ActorIsolation::GlobalActor:
2439
2431
case ActorIsolation::GlobalActorUnsafe:
2440
2432
case ActorIsolation::Independent:
2441
- case ActorIsolation::IndependentUnsafe:
2442
2433
break ;
2443
2434
}
2444
2435
@@ -2463,7 +2454,6 @@ static Optional<ActorIsolation> getIsolationFromWitnessedRequirements(
2463
2454
llvm_unreachable (" protocol requirements cannot be actor instances" );
2464
2455
2465
2456
case ActorIsolation::Independent:
2466
- case ActorIsolation::IndependentUnsafe:
2467
2457
// We only need one @actorIndependent.
2468
2458
if (sawActorIndependent)
2469
2459
return true ;
@@ -2525,8 +2515,7 @@ ActorIsolation ActorIsolationRequest::evaluate(
2525
2515
// A @Sendable function is assumed to be actor-independent.
2526
2516
if (auto func = dyn_cast<AbstractFunctionDecl>(value)) {
2527
2517
if (func->isSendable ()) {
2528
- defaultIsolation = ActorIsolation::forIndependent (
2529
- ActorIndependentKind::Safe);
2518
+ defaultIsolation = ActorIsolation::forIndependent ();
2530
2519
}
2531
2520
}
2532
2521
@@ -2545,8 +2534,6 @@ ActorIsolation ActorIsolationRequest::evaluate(
2545
2534
// inferred, so that (e.g.) it will be printed and serialized.
2546
2535
ASTContext &ctx = value->getASTContext ();
2547
2536
switch (inferred) {
2548
- // FIXME: if the context is 'unsafe', is it fine to infer the 'safe' one?
2549
- case ActorIsolation::IndependentUnsafe:
2550
2537
case ActorIsolation::Independent:
2551
2538
value->getAttrs ().add (new (ctx) ActorIndependentAttr (
2552
2539
ActorIndependentKind::Safe, /* IsImplicit=*/ true ));
@@ -2719,12 +2706,6 @@ void swift::checkOverrideActorIsolation(ValueDecl *value) {
2719
2706
if (isolation == overriddenIsolation)
2720
2707
return ;
2721
2708
2722
- // If the overridden declaration is @actorIndependent(unsafe) and the
2723
- // overriding declaration has been placed in a global actor, allow it.
2724
- if (overriddenIsolation.getKind () == ActorIsolation::IndependentUnsafe &&
2725
- isolation.isGlobalActor ())
2726
- return ;
2727
-
2728
2709
// If the overridden declaration is from Objective-C with no actor annotation,
2729
2710
// and the overriding declaration has been placed in a global actor, allow it.
2730
2711
if (overridden->hasClangNode () && !overriddenIsolation &&
@@ -2736,7 +2717,6 @@ void swift::checkOverrideActorIsolation(ValueDecl *value) {
2736
2717
if (overriddenIsolation == ActorIsolation::GlobalActorUnsafe) {
2737
2718
switch (isolation) {
2738
2719
case ActorIsolation::Independent:
2739
- case ActorIsolation::IndependentUnsafe:
2740
2720
case ActorIsolation::Unspecified:
2741
2721
return ;
2742
2722
@@ -2765,7 +2745,6 @@ void swift::checkOverrideActorIsolation(ValueDecl *value) {
2765
2745
2766
2746
case ActorIsolation::ActorInstance:
2767
2747
case ActorIsolation::Independent:
2768
- case ActorIsolation::IndependentUnsafe:
2769
2748
// Diagnose below.
2770
2749
break ;
2771
2750
0 commit comments