RS.CLIPPY.MULTIPLE_BOUND_LOCATIONS
Defining generic bounds in multiple locations
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: multiple_bound_locations. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Check if a generic is defined both in the bound predicate and in the where clause.
Why is this bad?
It can be confusing for developers when seeing bounds for a generic in multiple places.
Example
fn ty<F: std::fmt::Debug>(a: F)
where
F: Sized,
{}
Use instead:
fn ty<F>(a: F)
where
F: Sized + std::fmt::Debug,
{}