Skip to content

[cxx-interop] Import certain types as @unsafe #76429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

Xazax-hun
Copy link
Contributor

@Xazax-hun Xazax-hun commented Sep 12, 2024

In this mode all C++ types are imported as unsafe by default. Users explicitly marking types are escapable or not escapable can make them imported as safe. In the future, we also want to import unannotated functions as unsafe and add more logic to infer types that are actually safe, like aggregates of escapable types.

rdar://135876415

@Xazax-hun Xazax-hun added the c++ interop Feature: Interoperability with C++ label Sep 12, 2024
@Xazax-hun
Copy link
Contributor Author

@swift-ci please smoke test

@ahoppen ahoppen removed their request for review September 13, 2024 20:00
@Xazax-hun Xazax-hun force-pushed the gaborh/safe-cxx-interop-mode branch from 5b77dbd to 0e740f8 Compare September 19, 2024 11:34
In this mode all C++ types are imported as unsafe by default. Users
explicitly marking types are escapable or not escapable can make them
imported as safe. In the future, we also want to import unannotated
functions as unsafe and add more logic to infer types that are actually
safe, like agregates of escapable types.
@Xazax-hun Xazax-hun force-pushed the gaborh/safe-cxx-interop-mode branch from 0e740f8 to 929c0ca Compare September 19, 2024 11:34
@Xazax-hun
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@egorzhdan egorzhdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Xazax-hun Xazax-hun merged commit 4d01253 into main Sep 19, 2024
3 checks passed
@Xazax-hun Xazax-hun deleted the gaborh/safe-cxx-interop-mode branch September 19, 2024 16:25
@Xazax-hun Xazax-hun changed the title [cxx-interop] Introduce a safe C++ interop mode [cxx-interop] Import certain types as @unsafe Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants