pub trait Shiftable<'a> {
type Inner: ?Sized + Substitution<'a>;
// Required method
fn shifted<'c>(&'c self) -> Shifted<'c, Self::Inner>;
}
Expand description
A substitution that can be converted into a Shifted
substitution. All types other than Shifted
itself should
implement this with the obvious option of
impl<'a> Shiftable<'a> for A {
type Inner = Self;
fn shifted<'b>(&'b self) -> Shifted<'b, Self::Inner> { Shifted::new(self) }
}
Unfortunately, it is not reasonably possible to provide this automatically without specialization.