[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ-ks9=JMWQMTdJSkdVGJus1mcRQWZ-34B_s4Ti7ab5NAdA6pg@mail.gmail.com>
Date: Wed, 19 Feb 2025 09:32:35 -0500
From: Tamir Duberstein <tamird@...il.com>
To: Alice Ryhl <aliceryhl@...gle.com>
Cc: Michal Rostecki <vadorovsky@...tonmail.com>, Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>, Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>, 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 Wed, Feb 19, 2025 at 9:21 AM Alice Ryhl <aliceryhl@...gle.com> wrote:
>
> On Tue, Feb 18, 2025 at 5:05 PM Tamir Duberstein <tamird@...il.com> wrote:
> >
> > Gentle ping. Trevor, Alice, Benno: you all participated in the last
> > round of review - I'd appreciate it if you could take a look at this
> > series.
>
> The primary thing that comes to mind looking at this is that losing
> the Display impl is pretty sad. Having to jump through hoops every
> time you want to print a string isn't great :(
There's the practical answer and the philosophical one. The former is
that core::ffi::CStr doesn't impl Display. The latter is that Display
implementations aren't meant to be lossy, and we shouldn't make it
ergonomic to do things that might surprise the user.
We could add our own UnicodeCStr which could impl Display and be
AsRef<CStr>. Do you think that should gate this work?
Powered by blists - more mailing lists