Skip to content
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

cxx-qt-gen: allow for safe / unsafe extern "RustQt" #1199

Merged
merged 5 commits into from
Feb 27, 2025

Conversation

ahayzen-kdab
Copy link
Collaborator

No description provided.

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (3d34588) to head (9acb532).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1199   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           73        73           
  Lines        12446     12458   +12     
=========================================
+ Hits         12446     12458   +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

We effectively ignore if the unsafe is specified and always consider
it to be safe.
@ahayzen-kdab ahayzen-kdab marked this pull request as ready for review February 26, 2025 16:51
Copy link
Collaborator

@LeonMatthesKDAB LeonMatthesKDAB left a comment

Choose a reason for hiding this comment

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

I found some issues after all

As if the individual function is unsafe the block can also be
unsafe without any change in behaviour.
@ahayzen-kdab ahayzen-kdab force-pushed the extern-rustqt-safe branch 3 times, most recently from 3290a98 to 69abab5 Compare February 27, 2025 14:36
C++Qt block and fn following their original unsafe.
RustQt blocks
- invokables forward the block or fn unsafe to the fn
- signals follow the fn unsafe to the fn
- inherit (and signals) require either block or fn

Anything with pointers in the arguments requires unsafe
on the fn as required by CXX.
Copy link
Collaborator

@LeonMatthesKDAB LeonMatthesKDAB left a comment

Choose a reason for hiding this comment

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

This seems to behave correctly now.

@ahayzen-kdab ahayzen-kdab merged commit bd0fbc7 into KDAB:main Feb 27, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants