macro_rules! cov { (<$($tv:ident $(: $bound:tt $(+ $bounds:tt)*)?),*> $thing:ty) => { ... }; ($thing:ty) => { ... }; }
Expand description
Macro that implements Cov
safely for a Ctor
type.
Cov::cov
is implemented by simply returning the input reference and letting Rust coerce it.
This should work automatically for most types that are actually covariant. In case cov!(MyType)
does not compile, users would need to provide their own unsafe
Cov
implementation.
See Cov
for an example.