[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJ-ks9=Q3qwY-efP=hRH2N9XSZf6pN-2fCUMyC8z3p1jwVj3wg@mail.gmail.com>
Date: Fri, 14 Mar 2025 10:15:06 -0400
From: Tamir Duberstein <tamird@...il.com>
To: Gary Guo <gary@...yguo.net>
Cc: Alice Ryhl <aliceryhl@...gle.com>, Michal Rostecki <vadorovsky@...tonmail.com>,
Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>, Andreas Hindborg <a.hindborg@...nel.org>,
Trevor Gross <tmgross@...ch.edu>, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v8 0/4] rust: replace kernel::str::CStr w/ core::ffi::CStr
On Fri, Feb 21, 2025 at 10:59 AM Tamir Duberstein <tamird@...il.com> wrote:
>
> On Fri, Feb 21, 2025 at 9:28 AM Gary Guo <gary@...yguo.net> wrote:
> >
> > I'd want to add that we currently also have our own `BStr` and then we
> > have the `CStr` -> `BStr` -> `[u8]` deref chain which is quite often
> > useful. If we move to the `core::ffi::CStr` then we would lose ability
> > to do so.
>
> True. The best we could do is `impl AsRef<BStr> for CStr`, I think.
BStr now exists upstream (though it is unstable for now). Please see
https://github.com/Rust-for-Linux/linux/issues/1146.
I sent https://github.com/rust-lang/rust/pull/138498 to see whether it
is possible to retain this functionality in the end state where
upstream's BStr is stable and we're able to use it.
Powered by blists - more mailing lists