refactor: enable clippy unsafe blocks related lints#576
Conversation
…s_per_block` clippy lints
6094199 to
bdc82c4
Compare
|
You need to verify on other platforms too, but I enabled auto-merge! |
|
Honestly, I do not know why this commit fixed the error reported by Miri (see the last failed CI pipeline): 6b30a7a. I wrote a similar example in the playground, and it works with the previous approach: https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=3912329ddc1fc332b47c22ce68d33fdd. Maybe it's a bug in the stacked borrows implementation (they are still experimental). But then, why did it not happen before? 🤔🤔🤔 |
| // SAFETY: `sspi_context_ptr` is a valid, local pointer to the `SspiHandle` allocated by the `p_ctx_handle_to_sspi_context`. | ||
| let sspi_context_ptr = unsafe { sspi_context_ptr.as_mut() }; |
There was a problem hiding this comment.
I’m a bit surprised by this because obtaining a pointer is generally not unsafe 🤔
Very good question! It’s nice that you wrote a reproducer, unfortunate that it didn’t help isolate the issue 😕 |
https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
https://rust-lang.github.io/rust-clippy/master/index.html#multiple_unsafe_ops_per_block