swift
cccf6c11 - Introduce `@unsafe` and the ability to prohibit use of unsafe declarations

Commit
2 years ago
Introduce `@unsafe` and the ability to prohibit use of unsafe declarations Allow any declaration to be marked with `@unsafe`, meaning that it involves unsafe code. This also extends to C declarations marked with the `swift_attr("unsafe")` attribute. Under a separate experimental flag (`DisallowUnsafe`), diagnose any attempt to use an `@unsafe` declaration or any unsafe language feature (such as `unowned(unsafe)`, `@unchecked Sendable`). This begins to define a "safe" mode in Swift that prohibits memory-unsafe constructs.
Author
Committer
Parents
Loading