Re: [PATCH v2 10/83] block: rust: allow `hrtimer::Timer` in `RequestData`
From: 하승종
Date: Fri Jun 26 2026 - 13:42:40 EST
2026년 6월 10일 (수) 오전 4:23, Andreas Hindborg <a.hindborg@xxxxxxxxxx>님이 작성:
> + fn cancel(&mut self) -> bool {
> + let request_data_ptr = &self.inner.wrapper_ref().data as *const T::RequestData;
I think this trips clippy::ref_as_ptr, which is enabled in the top-level
Makefile (-Wclippy::ref_as_ptr), so `make CLIPPY=1` fails here under
CONFIG_RUST_WERROR. IMO core::ptr::from_ref() would read better.
> + let pdu_ptr = self.data_ref() as *const T::RequestData;
Same here, I'd go with:
let pdu_ptr = core::ptr::from_ref(self.data_ref());
I applied both changes on top of rnull-v7.1-rc2 and `make CLIPPY=1` passes
cleanly here (the two ref_as_ptr errors go away, no new warnings).
Best regards,
SeungJong Ha
---
I'm not a regular reviewer for this subsystem — I just ran into this while
building your rnull tree with clippy. Let me know if drive-by notes like this
aren't the right fit here.