about summary refs log tree commit diff
path: root/src/util/trait_impls.rs
blob: ba15f7119d26b2b1fc4e66ede88f5b5cff309994 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
macro_rules! ref_impl {
    (impl<T: $traitb: ident $(+ $bound:ident)*> $traiti:ident for &T {
        $($body:tt)*
    }) => {
        impl<'a, T: $traitb $(+ $bound)*> $traiti for &'a T {
            $($body)*
        }

        impl<'a, T: $traitb $(+ $bound)*> $traiti for &'a mut T {
            $($body)*
        }

        impl<T: $traitb $(+ $bound)*> $traiti for ::std::boxed::Box<T> {
            $($body)*
        }
    };
}