Skip to content

Forbid or deny unsafe code #26

Open

Description

@robo9k

Since the crate contains no unsafe code except in mod tests, it would be possible to add #![deny(unsafe_code)] and then #[allow(unsafe_code)] for the tests.

I don't really see the advantage in that.
Users of this crate will have to use unsafe code to interact with the extern "C" functions anyways.

Activity

  1. robo9k commented on Feb 12, 2022

    @robo9k
    OwnerAuthor

    See robo9k/rust-magic#40 for some related high-level changes.

  2. robo9k commented on Sep 26, 2023

    @robo9k
    OwnerAuthor
  3. robo9k commented on Feb 21, 2025

    @robo9k
    OwnerAuthor

    Edition 2024 requires unsafe on extern blocks https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-extern.html
    Everything else in the crate could still deny unsafe.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions