Re: [PATCH v2 10/83] block: rust: allow `hrtimer::Timer` in `RequestData`
From: Andreas Hindborg
Date: Tue Jul 07 2026 - 09:49:38 EST
하승종 <engineer.jjhama@xxxxxxxxx> writes:
> 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.
Thanks. I'm not sure why I did not see clippy complaining. I agree
`ptr::from_ref` is a better choice.
>
>> + 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).
I'll add this in next version.
>
> 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.
I appreciate the comments, please do continue sending them if you come
across more stuff.
Best regards,
Andreas