2022-09-28 15:54:39 -05:00
|
|
|
pub trait Main {
|
|
|
|
type Item;
|
|
|
|
|
|
|
|
type Out0: Support<Item = ()>;
|
|
|
|
type Out1: Support<Item = Self::Item>;
|
|
|
|
type Out2<T>: Support<Item = T>;
|
|
|
|
type Out3: Support<Produce<()> = bool>;
|
|
|
|
type Out4<T>: Support<Produce<T> = T>;
|
|
|
|
type Out5: Support<Output<'static> = &'static ()>;
|
|
|
|
type Out6: for<'a> Support<Output<'a> = &'a ()>;
|
|
|
|
type Out7: Support<Item = String, Produce<i32> = u32> + Unrelated;
|
|
|
|
type Out8: Unrelated + Protocol<i16, Q1 = u128, Q0 = ()>;
|
|
|
|
type Out9: FnMut(i32) -> bool + Clone;
|
|
|
|
type Out10<'q>: Support<Output<'q> = ()>;
|
|
|
|
type Out11: for<'r, 's> Helper<A<'s> = &'s (), B<'r> = ()>;
|
|
|
|
type Out12: for<'w> Helper<B<'w> = std::borrow::Cow<'w, str>, A<'w> = bool>;
|
2022-10-04 07:08:25 -05:00
|
|
|
type Out13: for<'fst, 'snd> Aid<'snd, Result<'fst> = &'fst mut str>;
|
2022-10-18 08:34:41 -05:00
|
|
|
type Out14<P: Copy + Eq, Q: ?Sized>;
|
2022-09-28 15:54:39 -05:00
|
|
|
|
|
|
|
fn make<F>(_: F, _: impl FnMut(&str) -> bool)
|
|
|
|
where
|
|
|
|
F: FnOnce(u32) -> String,
|
|
|
|
Self::Out2<()>: Protocol<u8, Q0 = Self::Item, Q1 = ()>;
|
|
|
|
}
|
|
|
|
|
|
|
|
pub trait Support {
|
|
|
|
type Item;
|
|
|
|
type Output<'a>;
|
|
|
|
type Produce<T>;
|
|
|
|
}
|
|
|
|
|
|
|
|
pub trait Protocol<K> {
|
|
|
|
type Q0;
|
|
|
|
type Q1;
|
|
|
|
}
|
|
|
|
|
|
|
|
pub trait Unrelated {}
|
|
|
|
|
|
|
|
pub trait Helper {
|
|
|
|
type A<'q>;
|
|
|
|
type B<'q>;
|
|
|
|
}
|
2022-10-04 07:08:25 -05:00
|
|
|
|
|
|
|
pub trait Aid<'src> {
|
2022-11-02 09:17:34 -05:00
|
|
|
type Result<'inter: 'src>;
|
2022-10-04 07:08:25 -05:00
|
|
|
}
|
2023-06-22 03:42:02 -05:00
|
|
|
|
|
|
|
pub trait Implementee {
|
|
|
|
type Alias<T: Eq>
|
|
|
|
where
|
|
|
|
String: From<T>;
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct Implementor;
|
|
|
|
|
|
|
|
impl Implementee for Implementor {
|
|
|
|
type Alias<T: Eq> = T
|
|
|
|
where
|
|
|
|
String: From<T>,
|
|
|
|
// We will check that this bound doesn't get turned into an item bound since
|
|
|
|
// associated types in impls are not allowed to have any.
|
|
|
|
Self::Alias<T>: From<Self::Alias<T>>;
|
|
|
|
}
|