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

Consider opting for unsafe_op_in_unsafe_fn #285

Closed
nbdd0121 opened this issue May 21, 2021 · 2 comments · Fixed by #339
Closed

Consider opting for unsafe_op_in_unsafe_fn #285

nbdd0121 opened this issue May 21, 2021 · 2 comments · Fixed by #339
Labels
• lib Related to the `rust/` library.

Comments

@nbdd0121
Copy link
Member

#![warn(unsafe_op_in_unsafe_fn)] will no longer make unsafe fn imply a unsafe {} surrounding the body. We should consider switching it on to make all unsafe operations explicit, even inside unsafe fn. This will ensure that all operations in unsafe fn still have their invariants audited and upheld.

This feature is stablised in Rust 1.52 so we may want a newer version of Rust nightly.

@ojeda
Copy link
Member

ojeda commented May 21, 2021

I would definitely want that.

@ojeda ojeda added prio: normal • lib Related to the `rust/` library. labels May 21, 2021
@ojeda
Copy link
Member

ojeda commented May 22, 2021

Depends on #135.

ojeda added a commit to ojeda/linux that referenced this issue Jun 3, 2021
This includes non-`rust/` code.

As soon as the warnings are cleaned up, we can move it to a hard error.

Fixes: Rust-for-Linux#285

Signed-off-by: Miguel Ojeda <[email protected]>
@ojeda ojeda closed this as completed in #339 Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
• lib Related to the `rust/` library.
Development

Successfully merging a pull request may close this issue.

2 participants