Skip to content

Add unsafe_precondition_assert! #1162

Closed

Description

@ojeda

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.

Activity

  1. added
    easyExpected to be an easy issue to resolve.
    mediumExpected to be an issue of medium difficulty to resolve.
    on Apr 29, 2025
  2. hz2 commented on Apr 29, 2025

    @hz2

    hi id like to take this on

  3. ojeda commented on Apr 29, 2025

    @ojeda
    MemberAuthor

    Sure, thanks, please go ahead!

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

  4. hz2 commented on Apr 29, 2025

    @hz2

    thank you!

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

  5. ojeda commented on Apr 29, 2025

    @ojeda
    MemberAuthor

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

  6. BennoLossin commented on Apr 30, 2025

    @BennoLossin
    Member

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

  7. ojeda commented on Apr 30, 2025

    @ojeda
    MemberAuthor

    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.

  8. ojeda commented on Feb 2, 2026

    @ojeda
    MemberAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    easyExpected to be an easy issue to resolve.good first issueGood for newcomersmediumExpected to be an issue of medium difficulty to resolve.• libRelated to the `rust/` library.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions