style_derive::cg

Function propagate_clauses_to_output_type

source
pub(crate) fn propagate_clauses_to_output_type(
    where_clause: &mut Option<WhereClause>,
    generics: &Generics,
    trait_path: &Path,
    trait_output: &Ident,
)
Expand description

Given an input type which has some where clauses already, like:

struct InputType where T: Zero, { … }

Add the necessary where clauses so that the output type of a trait fulfils them.

For example:

    <T as ToComputedValue>::ComputedValue: Zero,

This needs to run before adding other bounds to the type parameters.