Re: [PATCH 2/4] rust: pin-init: internal: suppress multiple_bound_locations
From: Gary Guo
Date: Wed Nov 18 2026 - 21:23:12 EST
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@xxxxxxxxxxx>
> Fixes: 73cf61724648 ("rust: pin-init: internal: pin_data: support existential lifetimes")
> Signed-off-by: Danilo Krummrich <dakr@xxxxxxxxxx>
> ---
> 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