Skip to content

Commit 0a80e97

Browse files
authored
Merge pull request #80817 from xedin/remove-missed-execution-attr-refs
[Docs] NFC: Remove last remaining references to `@execution` attribute
2 parents 87ca0f8 + 4b1695b commit 0a80e97

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/ABI/Mangling.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ Types
761761
sending-result ::= 'YT' // -> sending T
762762
#endif
763763
#if SWIFT_RUNTIME_VERSION >= 6.2
764-
function-isolation :== 'YC' // @execution(caller) on function type
764+
function-isolation :== 'YC' // nonisolated(nonsending) on function type
765765
#endif
766766
differentiable ::= 'Yjf' // @differentiable(_forward) on function type
767767
differentiable ::= 'Yjr' // @differentiable(reverse) on function type

userdocs/diagnostics/sending-risks-data-race.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ await person.printNameConcurrently()
2929

3030
This happens because the `printNameConcurrently` function runs off of the main actor, and the `onMainActor` function suspends while waiting for `printNameConcurrently` to complete. While suspended, the main actor can run other tasks that still have access to `person`, which can lead to a data race.
3131

32-
The most common fix is to change the `async` method to run on the caller's actor using the `@execution(caller)` attribute:
32+
The most common fix is to change the `async` method to run on the caller's actor using the `nonisolated(nonsending)` specifier:
3333

3434
```swift
3535
class Person {
3636
var name: String = ""
3737

38-
@execution(caller)
38+
nonisolated(nonsending)
3939
func printNameConcurrently() async {
4040
print(name)
4141
}
@@ -49,4 +49,4 @@ func onMainActor(person: Person) async {
4949

5050
This eliminates the risk of data-races because `printNameConcurrently` continues to run on the main actor, so all access to `person` is serialized.
5151

52-
You can also enable the `AsyncCallerExecution` upcoming feature to make `@execution(caller)` the default for async functions on non-`Sendable` types.
52+
You can also enable the `AsyncCallerExecution` upcoming feature to make `nonisolated(nonsending)` the default for async functions on non-`Sendable` types.

0 commit comments

Comments
 (0)