Skip to content

Commit fbe7bca

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 fbe7bca

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,11 @@ 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 are not yet generalized to support non-escapable types in Swift 6.2 limiting the
110+
usability of these types.
111+
</div>
112+
108113
### Annotating C++ APIs
109114
110115
Building the code again will emit a new diagnostic for the `fileName` function about
@@ -387,6 +392,12 @@ compiler can bridge those span-like parameters to Swift's
387392
and [`MutableSpan`](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0467-MutableSpan.md)
388393
types, and the user with a safe and convenient interface to those imported APIs.
389394
395+
<div class="info" markdown="1">
396+
Currently, on the Swift 6.2 release branch, the features described in this section
397+
are behind an experimental feature flag. To enable these features pass `-enable-experimental-feature SafeInteropWrappers`
398+
to the 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)