use core::{convert::Infallible, ops::Add};
pub enum NoDrop {}
pub enum Inner {}
pub enum Custom {}
pub struct WithDrop<K: DropKind>(core::marker::PhantomData<K>, Infallible);
#[sealed::sealed]
pub trait DropKind {}
#[sealed::sealed]
impl DropKind for Inner {}
#[sealed::sealed]
impl DropKind for Custom {}
impl Add<Self> for NoDrop {
type Output = Self;
fn add(self, _: Self) -> Self::Output {
unreachable!()
}
}
impl Add<WithDrop<Custom>> for NoDrop {
type Output = WithDrop<Inner>;
fn add(self, _: WithDrop<Custom>) -> Self::Output {
unreachable!()
}
}
impl Add<WithDrop<Inner>> for NoDrop {
type Output = WithDrop<Inner>;
fn add(self, _: WithDrop<Inner>) -> Self::Output {
unreachable!()
}
}
impl<Rhs> Add<Rhs> for WithDrop<Inner> {
type Output = Self;
fn add(self, _: Rhs) -> Self::Output {
unreachable!()
}
}
impl Add<NoDrop> for WithDrop<Custom> {
type Output = Self;
fn add(self, _: NoDrop) -> Self::Output {
unreachable!()
}
}
impl Add<Self> for WithDrop<Custom> {
type Output = WithDrop<Inner>;
fn add(self, _: Self) -> Self::Output {
unreachable!()
}
}
impl Add<WithDrop<Inner>> for WithDrop<Custom> {
type Output = WithDrop<Inner>;
fn add(self, _: WithDrop<Inner>) -> Self::Output {
unreachable!()
}
}