-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add attribute for Swift ownership support (#314)
This commit introduces a new attribute that can be used to enable experimental support for Swift ownership. The new `__experimental_swift_ownership` can be used on an opaque Rust type. ```rust #[swift_bridge::bridge] mod foo { extern "Rust" { #[swift_bridge(__experimental_swift_ownership)] type SomeType; } } ``` This new attribute currently does nothing. In future commits, when `swift-bridge` sees that a type has the experimental ownership attribute it will generate code that takes advantage of Swift 6's ownership features. For instance, we will use Swift's `~Copyable` protocol to ensure that when Swift has ownership over an opaque Rust type it cannot copy that handle, which should make attempts to use-after-free a compile-time error instead of a runtime error.
- Loading branch information
Showing
3 changed files
with
173 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters