use std::marker::PhantomData;
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct PhantomCovariant<T>(PhantomData<fn() -> T>)
where
T: ?Sized;
impl<T> PhantomCovariant<T>
where
T: ?Sized,
{
pub const fn new() -> Self {
PhantomCovariant(PhantomData)
}
}
impl<T> Clone for PhantomCovariant<T>
where
T: ?Sized,
{
fn clone(&self) -> Self {
*self
}
}
impl<T> Copy for PhantomCovariant<T> where T: ?Sized {}
impl<T> Default for PhantomCovariant<T>
where
T: ?Sized,
{
fn default() -> Self {
Self::new()
}
}