[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1ef96145-9d58-4b61-a3bb-045dee6e4fd5@de.bosch.com>
Date: Thu, 5 Feb 2026 14:23:41 +0100
From: Dirk Behme <dirk.behme@...bosch.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>, Dirk Behme
<dirk.behme@...il.com>
CC: Gary Guo <gary@...yguo.net>, Onur Özkan
<work@...rozkan.dev>, Jkhall81 <jason.kei.hall@...il.com>, <joe@...ches.com>,
<ojeda@...nel.org>, <rust-for-linux@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4] scripts: checkpatch: warn on Rust panicking methods
On 04.02.2026 19:10, Miguel Ojeda wrote:
> On Wed, Feb 4, 2026 at 4:56 PM Dirk Behme <dirk.behme@...il.com> wrote:
>>
>> The question is if we could find a way to make it *consistent*?
>>
>> I mean how should a developer know if the warning (he gets once, or
>> even if he checks an existing file with -f always) is relevant or not?
>> We introduce the warning because we want to discourage the use of
>> `unwrap()`. At the same time there are places where its usage is
>> allowed or even needed. How to know what is valid? The warning or the
>> usage?
>
> I think usually developers use `checkpatch.pl` mostly on patches, not
> existing files; plus it doesn't make the build fail. Thus I see
> `checkpatch.pl` as a tool that can have way more false positives than
> a linter that we need to keep strictly clean.
And how would a developer know that a `checkpatch.pl` warning on
`unwrap()` is a false positive or not (i.e. is to be fixed)?
Thanks
Dirk
> The idea with the `checkpatch.pl` warning was to have something we
> could land easily before we got the new Clippy lints, and perhaps to
> apply it in more cases than the eventual Clippy lint (since false
> positives are not as concerning).
>
> I have some context in
> https://github.com/rust-lang/rust-clippy/issues/15895 -> "Additional
> context", and a few other issues linked in
> https://github.com/Rust-for-Linux/linux/issues/349 for the new lints.
>
> Cheers,
> Miguel
Powered by blists - more mailing lists