From: "Gary Guo" <gary@garyguo.net>
To: "Danilo Krummrich" <dakr@kernel.org>, <aliceryhl@google.com>,
<daniel.almeida@collabora.com>, <airlied@gmail.com>,
<simona@ffwll.ch>, <lossin@kernel.org>, <gary@garyguo.net>,
<ojeda@kernel.org>, <boqun@kernel.org>,
<bjorn3_gh@protonmail.com>, <a.hindborg@kernel.org>,
<tmgross@umich.edu>, <tamird@kernel.org>, <acourbot@nvidia.com>,
<work@onurozkan.dev>
Cc: <dri-devel@lists.freedesktop.org>,
<rust-for-linux@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/4] rust: pin-init: internal: suppress multiple_bound_locations
Date: Thu, 19 Nov 2026 02:23:03 +0000 [thread overview]
Message-ID: <DMYTVUY54BWF.3LB7RP624VBRB@garyguo.net> (raw)
In-Reply-To: <20261118233727.3147222-3-dakr@kernel.org>
On Wed Nov 18, 2026 at 11:37 PM GMT, Danilo Krummrich wrote:
> The generated __drop_order_check() combines existential lifetime bounds
> with inferred field outlives bounds.
>
> For instance, for Tyr's Firmware, this places 'res: 'fw in the generic
> parameter list and 'res: 'vm in the where clause, triggering Clippy's
> multiple_bound_locations lint at the struct declaration.
This paragraph is sloppy. It is not helpful at all without context (and also
doesn't describe the issue properly even with context).
Anyway, this issue is known and I ran into it in drm jobqueue myself. That said,
I plan to fix it with proper spans rather than band-aiding it with an allow (I
also cannot take it as is without a UI test case to catch regression). I'd
recommend putting a `#![allow(clippy::multiple_bound_locations)]` for now.
Best,
Gary
> Allow this style lint on the generated drop-order check. This preserves
> all generated bounds and leaves the lint enabled for user-written code.
>
> Cc: Gary Guo <gary@garyguo.net>
> Fixes: 73cf61724648 ("rust: pin-init: internal: pin_data: support existential lifetimes")
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
> ---
> rust/pin-init/internal/src/pin_data.rs | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/rust/pin-init/internal/src/pin_data.rs b/rust/pin-init/internal/src/pin_data.rs
> index 08e11128d353..b3c487999270 100644
> --- a/rust/pin-init/internal/src/pin_data.rs
> +++ b/rust/pin-init/internal/src/pin_data.rs
> @@ -1246,7 +1246,8 @@ fn generate_drop_order_check(dcx: &mut DiagCtxt, info: &StructInfo) -> TokenStre
>
> let struct_span = struct_name.span().resolved_at(Span::mixed_site());
> quote_spanned! {struct_span =>
> - #[allow(non_snake_case, unused)]
> + // Generated bounds can appear both on lifetime parameters and in the where clause.
> + #[allow(non_snake_case, unused, clippy::multiple_bound_locations)]
> fn __drop_order_check #impl_generics_with_field_lt (
> // This must be present so the function can *assume* the implied bounds on the erased
> // struct. For example, if the struct has `&'a T`, Rust will infer `T: 'a`; we still
next prev parent reply other threads:[~2026-11-19 2:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 23:37 [PATCH 0/4] drm/tyr: use pin-init self-referential support Danilo Krummrich
2026-11-18 23:37 ` [PATCH 1/4] drm/tyr: name resource lifetimes after their types Danilo Krummrich
2026-11-19 2:08 ` Gary Guo
2026-11-19 10:34 ` Danilo Krummrich
2026-11-19 11:28 ` Gary Guo
2026-11-18 23:37 ` [PATCH 2/4] rust: pin-init: internal: suppress multiple_bound_locations Danilo Krummrich
2026-11-19 2:23 ` Gary Guo [this message]
2026-11-18 23:37 ` [PATCH 3/4] drm/tyr: use pin-init self-referential support Danilo Krummrich
2026-11-18 23:37 ` [PATCH 4/4] drm/tyr: use ScopeGuard for firmware loading cleanup Danilo Krummrich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DMYTVUY54BWF.3LB7RP624VBRB@garyguo.net \
--to=gary@garyguo.net \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox