Skip to content

Commit a857121

Browse files
committed
@exclusivity(unchecked) is also an unsafe feature
Thank you to Jed Fox!
1 parent 961b76a commit a857121

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

proposals/nnnn-strict-memory-safety.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ The following language constructs are always considered to be unsafe:
214214

215215
* `unowned(unsafe)`: Used to store a reference without maintaining its reference count. The safe counterpart, `unowned`, uses dynamic checking to ensure that the reference isn't accessed after the corresponding object has been released. The `unsafe` variant disables that dynamic checking. Uses of `unowned(unsafe)` entities are not memory-safe.
216216
* `unsafeAddressor`, `unsafeMutableAddressor`: These accessors vend an unsafe pointer, and are therefore unsafe to declare. Other accessors (e.g., `get` and `set`) can provide safe alternatives.
217+
* `@exclusivity(unchecked)`: Used to remove dynamic exclusivity checks from a particular variable, which can mean that dynamic exclusivity violations go undetected at run time, causing a memory safety violation.
217218

218219
The following language constructs are considered to be unsafe when strict concurrency checking is enabled (i.e., in the Swift 6 language mode):
219220

0 commit comments

Comments
 (0)