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

Recommend the systematic use of lint unsafe_op_in_unsafe_fn for crates with unsafe code #53

Open
polazarus opened this issue May 7, 2021 · 0 comments

Comments

@polazarus
Copy link
Contributor

With version 1.52, Rust supports a new lint to encourage Rust developers to mark unsafe code everywhere even in unsafe function.

In a security conscious development the global lint #![deny(unsafe_op_in_unsafe_fn)] should be present at the top of the crate, if the crate includes unsafe code.

Notable uses:

  • allow unsafe as a pure marker for should-not-be-used-from-Rust function which are not literally unsafe,
  • distinguish unsafe pointer-dereferencing code from safe wrapping code in extern "C" function definition.
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

No branches or pull requests

1 participant