Skip to main content

generate_trait_impl_intransitive

Function generate_trait_impl_intransitive 

Source
pub(crate) fn generate_trait_impl_intransitive(
    make: &SyntaxFactory,
    adt: &Adt,
    trait_: Type,
) -> Impl
Expand description

Generates the corresponding impl <trait> for Type {} including type and lifetime parameters, with impl‘s generic parameters’ bounds kept as-is.

This is useful for traits like From<T>, since impl<T> From<T> for U<T> doesn’t require T: From<T>.