use crate::vestibule::*;
pub use ghost::*; pub mod ghost {
#![allow(unreachable_code)]
#[derive(
Debug,
Clone, Copy,
Eq, PartialEq, Ord, PartialOrd,
Hash,
)]
pub
enum Ghost<T> {
Ghost,
#[allow(dead_code)]
#[doc(hidden)]
__(::never_say_never::Never, T),
}
pub use self::Ghost::*;
}
pub
type Ghost<T > = ghost::Ghost<::core::marker::PhantomData<T>>
;
impl<T> Ghost<T> {
#[doc(hidden)] pub
const
fn __set (self: &'_ Ghost<T>, value: T)
{
::core::mem::forget(value);
}
}
impl<T : ?Sized> Default
for Ghost<T>
{
#[inline]
fn default ()
-> Self
{
Ghost
}
}
impl<T : ?Sized> Ghost<T> {
#[inline]
pub
fn map<U> (
self: Ghost<T>,
f: Ghost<impl FnOnce(T, Ectoplasm) -> U>,
) -> Ghost<U>
where
T : Sized,
{
ghost!(
materialize!(f)(materialize!(self), materialize!(Ghost))
)
}
#[inline]
pub
fn and_then<U> (
self: Ghost<T>,
f: Ghost<impl FnOnce(T, Ectoplasm) -> Ghost<U>>,
) -> Ghost<U>
where
T : Sized,
{
ghost!(
materialize!(f)(materialize!(self), materialize!(Ghost))
) }
}