JelteF / derive_more

Some more derive(Trait) options
MIT License
1.73k stars 123 forks source link

Consider associated types of type parameters for implied bounds #399

Closed tyranron closed 2 months ago

tyranron commented 2 months ago

Related to #387

Synopsis

After #387, the following snippet fails to compile:

#[derive(Debug)]
struct AssocType<I: Iterator> {
    iter: I,
    elem: Option<I::Item>,
}

This happens, because the implied bound Option<I::Item>: Debug is not generated.

Solution

Correct the ContainsGenericsExt::contains_generics() implementations to consider associated types of the type parameter.

Checklist