Skip to content

Generic bounds on concrete types #15

@WaDelma

Description

@WaDelma

Normally your generics are form:

fn do_it<T>()
    where T: Add
{}

but you can also have generics of form:

fn do_it()
    where usize: Add

These bounds are sometimes useful for giving type checker more information in hard cases.
(I have encountered these while using typenum)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions