aboutsummaryrefslogtreecommitdiff
path: root/src/util.rs
blob: 78d2cd4ccc58615d276a2d9ad0ae159ec17bac83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
macro_rules! trait_alias {
    (
        $(#[$attr: meta])*
        $visibility: vis $name: ident$(<$($type_param: ident),*>)?$(: $first_bound: tt $(+ $bound: tt)*)?;
    ) => {
        $(#[$attr])*
        $visibility trait $name $(<$($type_param),*>)? $(: $first_bound $(+ $bound)*)? {}

        impl<T: $($first_bound $(+ $bound)*)?, $($($type_param),*)?> $name$(<$($type_param),*>)? for T {}
    };
}

pub(crate) use trait_alias;