[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGSQo01ssCYA2vxkbDmEnoSegH5ks_V=07LC3yE2Zp4eFDXiFw@mail.gmail.com>
Date: Fri, 3 Oct 2025 16:36:04 -0700
From: Matthew Maurer <mmaurer@...gle.com>
To: Danilo Krummrich <dakr@...nel.org>
Cc: gregkh@...uxfoundation.org, rafael@...nel.org, ojeda@...nel.org,
alex.gaynor@...il.com, boqun.feng@...il.com, gary@...yguo.net,
bjorn3_gh@...tonmail.com, lossin@...nel.org, a.hindborg@...nel.org,
aliceryhl@...gle.com, tmgross@...ch.edu, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/7] rust: debugfs: support blobs from smart pointers
>
> I think this way around is not compatible with scoped API.
>
I thought you'd just be able to deref inside the callback, but perhaps
I'm wrong. I'll try to find a chance to pull down the patch and check.
> >> +// Delegate for `Vec<T, A>`: Support a `Vec<T, A>` with an outer lock.
> >> +impl<T, A> BinaryReaderMut for Vec<T, A>
> >> +where
> >> + T: AsBytes + FromBytes,
> >> + A: Allocator,
> >> +{
> >> + fn read_from_slice_mut(
> >> + &mut self,
> >> + reader: &mut UserSliceReader,
> >> + offset: usize,
> >> + ) -> Result<usize> {
> >> + let slice = self.as_mut_slice();
> >> +
> >
> > Nit: This is safe, but it also requires `FromBytes`, and is &mut, &mut
>
> It already requires T: AsBytes + FromBytes above. Or do you mean something else?
I mean the safety comment. Your code is right, the comment needs to be updated.
Powered by blists - more mailing lists