Skip to content

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

Merged
ahayzen-kdab merged 5 commits intoKDAB:mainfrom
ahayzen-kdab:extern-rustqt-safe
Feb 27, 2025
Merged

cxx-qt-gen: allow for safe / unsafe extern "RustQt"#1199
ahayzen-kdab merged 5 commits intoKDAB:mainfrom
ahayzen-kdab:extern-rustqt-safe

Conversation

@ahayzen-kdab
Copy link
Copy Markdown
Collaborator

No description provided.

@codecov
Copy link
Copy Markdown

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 37 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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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
Copy Markdown

@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
Copy Markdown

@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
@LeonMatthesKDAB LeonMatthesKDAB added the ⏮️ backport-candidate Change which could be backported to the stable series label Apr 15, 2025
@LeonMatthesKDAB LeonMatthesKDAB mentioned this pull request Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⏮️ backport-candidate Change which could be backported to the stable series

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants