Re: [PATCH v16 01/10] rust: alloc: add `KBox::into_nonnull`
From: Miguel Ojeda
Date: Mon Mar 02 2026 - 07:39:58 EST
On Mon, Mar 2, 2026 at 8:19 AM Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:
>
> I was thinking something similar, in clippy or checkpatch.pl. If we
> should always have this attribute for small functions, we need to have a
> check.
No, as Gary said, we do not always want to have it.
So something trivial in `checkpatch.pl` or something like the existing
Clippy lint would have quite bad false positives (and even false
negatives, in the case of `checkpatch.pl`, depending on what logic you
are thinking about).
We would need cross-TU heuristics for this, because at the end of the
day what you are trying to say is "this function will end up being
trivial even if it may look like it doesn't before inlining
everything".
Cheers,
Miguel