Skip to content

Type alias for generics #3528

@hapenia

Description

@hapenia

TL;DR, I want this:

type<T> SomeType = T: Copy + Clone + Debug + OtherTrait

// you can do this
impl<T> SomeTrait for SomeStruct<T>
where T: SomeType {
    ...
}

// also
impl<T: SomeType> SomeTrait for SomeStruct<T> {
    ...
}

I believe this will greatly enhance the readability of ultra-long generic constraints. This is just a little inspiration that I had while reading the source code of some crate. Any other solutions are welcome to comment here :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions