Skip to content

Commit 469c9cf

Browse files
author
Gabor Horvath
committed
[cxx-interop] Document some caveats of safe interop
Some of these like the compiler flag to enable the safe wrappers is not documented anywhere. Having this documentation in place can help more people to play around with the feature and report bugs.
1 parent ca96fa8 commit 469c9cf

File tree

1 file changed

+11
-0
lines changed
  • documentation/cxx-interop/safe-interop

1 file changed

+11
-0
lines changed

documentation/cxx-interop/safe-interop/index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ struct SWIFT_NONESCAPABLE StringRef { ... };
105105
Now the Swift compiler imports `StringRef` as a safe type and no longer
106106
emits a warning about using an unsafe type.
107107
108+
<div class="info" markdown="1">
109+
Some containers and protocols do not yet support non-escapable types in Swift 6.2.
110+
</div>
111+
108112
### Annotating C++ APIs
109113
110114
Building the code again will emit a new diagnostic for the `fileName` function about
@@ -387,6 +391,13 @@ compiler can bridge those span-like parameters to Swift's
387391
and [`MutableSpan`](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0467-MutableSpan.md)
388392
types, and the user with a safe and convenient interface to those imported APIs.
389393
394+
<div class="info" markdown="1">
395+
At the time of writing, the features described in this section
396+
are behind an experimental feature flag on the Swift 6.2 release branch.
397+
To enable these features, pass `-enable-experimental-feature SafeInteropWrappers`
398+
to the Swift compiler.
399+
</div>
400+
390401
### C++ `std::span` Support
391402
392403
APIs taking or returning C++'s `std::span` with sufficient lifetime

0 commit comments

Comments
 (0)