rustc_lint_defs::builtin

Static UNUSED_ASSOCIATED_TYPE_BOUNDS

source
pub static UNUSED_ASSOCIATED_TYPE_BOUNDS: &Lint
Expand description

The unused_associated_type_bounds lint is emitted when an associated type bound is added to a trait object, but the associated type has a where Self: Sized bound, and is thus unavailable on the trait object anyway.

§Example

trait Foo {
    type Bar where Self: Sized;
}
type Mop = dyn Foo<Bar = ()>;

{{produces}}

§Explanation

Just like methods with Self: Sized bounds are unavailable on trait objects, associated types can be removed from the trait object.