[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <DAN5ZONHV9OX.1S5KRJJ0VFVB4@nvidia.com>
Date: Sun, 15 Jun 2025 23:08:35 +0900
From: "Alexandre Courbot" <acourbot@...dia.com>
To: "Miguel Ojeda" <miguel.ojeda.sandonis@...il.com>
Cc: "Danilo Krummrich" <dakr@...nel.org>, "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" <lossin@...nel.org>, "Andreas
Hindborg" <a.hindborg@...nel.org>, "Alice Ryhl" <aliceryhl@...gle.com>,
"Trevor Gross" <tmgross@...ch.edu>, <rust-for-linux@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 4/4] rust: str: implement `Borrow` and `BorrowMut`
for `CString`
On Sun Jun 15, 2025 at 10:57 PM JST, Miguel Ojeda wrote:
> On Sun, Jun 15, 2025 at 3:48 PM Alexandre Courbot <acourbot@...dia.com> wrote:
>>
>> I thought I could get away with it since it is in a test, and clippy
>> does not seem to complain about it, but...
>
> Hmm... It should:
>
> error: unsafe block missing a safety comment
> --> rust/doctests_kernel_generated.rs:7973:24
> |
> 7973 | let foo_borrowed = Foo(unsafe {
> CStr::from_bytes_with_nul_unchecked_mut(&mut str_data) });
> |
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Do you have the doctests enabled? i.e. CONFIG_RUST_KERNEL_DOCTESTS=y
... and that's what I was missing. ^_^; Thanks!
Powered by blists - more mailing lists