Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Foo;
- struct FooFilter<'a> {
- foo: &'a Foo,
- }
- trait Filter<'a> {
- type Output;
- fn make_filter(&'a mut self) -> Self::Output;
- }
- impl<'a> Filter<'a> for Foo {
- type Output = FooFilter<'a>;
- fn make_filter(&'a mut self) -> Self::Output {
- FooFilter { foo: &*self }
- }
- }
- pub trait Scan<Filter> {}
- impl<'a> Scan<FooFilter<'a>> for Foo {}
- trait Assert1<'a>
- where
- Self: Filter<'a>,
- Self: Scan<<Self as Filter<'a>>::Output>,
- {
- }
- impl<'a> Assert1<'a> for Foo {}
- trait Assert2
- where
- for<'a> Self: Filter<'a>,
- Self: for<'a> Scan<<Self as Filter<'a>>::Output>,
- {
- }
- impl Assert2 for Foo {}
- fn main() {}
Add Comment
Please, Sign In to add comment