Skip to content

Add unsafe_precondition_assert! #1162

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

Open
ojeda opened this issue Apr 29, 2025 · 6 comments
Open

Add unsafe_precondition_assert! #1162

ojeda opened this issue Apr 29, 2025 · 6 comments
Labels
easy Expected to be an easy issue to resolve. good first issue Good for newcomers medium Expected to be an issue of medium difficulty to resolve.

Comments

@ojeda
Copy link
Member

ojeda commented Apr 29, 2025

See https://lore.kernel.org/rust-for-linux/CANiq72mi47p0jVoXXq1d1G+7PnHi7ngs6zTS084igfZZzzNGBw@mail.gmail.com/.

Like #1159, but for unsafe_precondition_assert!.

The name mimics other {kind}_assert!s like debug_assert!, as well as core's ub-checks one (assert_unsafe_precondition!).

Please double check if there are already asserts out there (or perhaps even new ones) that could make use of it, and transform (or add) them in a second patch etc.


This requires submitting a proper patch to the LKML and the Rust for Linux mailing list. Please recall to test your changes (including generating the documentation if changed, running the Rust doctests if changed, etc.), to use a proper title for the commit, to sign your commit under the Developer's Certificate of Origin and to add a Suggested-by: tag, and a Link: tag to this issue. Please see https://docs.kernel.org/process/submitting-patches.html and https://rust-for-linux.com/contributing for details.

@ojeda ojeda added easy Expected to be an easy issue to resolve. good first issue Good for newcomers medium Expected to be an issue of medium difficulty to resolve. labels Apr 29, 2025
@hz2
Copy link

hz2 commented Apr 29, 2025

hi id like to take this on

@ojeda
Copy link
Member Author

ojeda commented Apr 29, 2025

Sure, thanks, please go ahead!

(For other readers/future issues: no need to mention it -- you all can just send the patch! :)

@hz2
Copy link

hz2 commented Apr 29, 2025

thank you!

for future reference, is there a way to check if a issue is already being worked on?

@ojeda
Copy link
Member Author

ojeda commented Apr 29, 2025

You're welcome!

Unless someone posts here, not really (one may want to search Lore for the issue link, though, e.g. https://lore.kernel.org/rust-for-linux/?q=https%3A%2F%2Fgithub.com%2FRust-for-Linux%2Flinux%2Fissues%2F1126.

So if you expect to take long to send it, it may be a good idea to still post a note here (but of course there is no need to ask for permission to start, if that makes sense).

@y86-dev
Copy link
Member

y86-dev commented Apr 30, 2025

@ojeda fyi this issue is both labeled easy and medium, is that intentional? (#1159 also has both labels)

@ojeda
Copy link
Member Author

ojeda commented Apr 30, 2025

Yeah, I meant it as "it could be either", or perhaps "in-between", depending on the person and/or the discussion in the list, so that people would find it if searching for either of the tags. I did it in others too, I think. But if it is confusing, we can remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy Expected to be an easy issue to resolve. good first issue Good for newcomers medium Expected to be an issue of medium difficulty to resolve.
Development

No branches or pull requests

3 participants