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

Enable the deny(unsafe_op_in_unsafe_fn) lint everywhere in librustzcash we define unsafe functions #703

Open
daira opened this issue Nov 15, 2022 · 2 comments

Comments

@daira
Copy link
Contributor

daira commented Nov 15, 2022

Similar to Electric-Coin-Company/zcash-light-client-ffi#65 :

A side-effect of declaring a function unsafe is that unsafe operations in its body are no longer required to be in unsafe blocks (see Rust RFC 2585 for a proposal to change this, not yet adopted). Ideally, we should enable the deny(unsafe_op_in_unsafe_fn) lint everywhere we define unsafe functions, since the style we write FFI functions in is mostly already consistent with that lint.

@daira
Copy link
Contributor Author

daira commented Nov 15, 2022

This can be enabled crate-wide by adding

[build]
rustflags = ["-Dunsafe_op_in_unsafe_fn"]

in .cargo/config.

@daira
Copy link
Contributor Author

daira commented Nov 16, 2022

This should also update all extern functions with safety requirements on callers to unsafe extern.

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

No branches or pull requests

1 participant