displaydoc::expand

Function extract_trait_constraints_from_source

source
fn extract_trait_constraints_from_source(
    where_clause: &WhereClause,
    type_params: &[&TypeParam],
) -> HashMap<Ident, Vec<TraitBound>>
Expand description

Map each declared generic type parameter to the set of all trait boundaries declared on it.

These boundaries may come from the declaration site: pub enum E<T: MyTrait> { … } or a where clause after the parameter declarations: pub enum E where T: MyTrait { … } This method will return the boundaries from both of those cases.