2 #![feature(type_alias_impl_trait)]
4 type X<A: ToString + Clone, B: ToString + Clone> = impl ToString;
6 fn f<A: ToString + Clone, B: ToString + Clone>(a: A, b: B) -> (X<A, B>, X<A, B>) {
10 pub trait Captures<'a> {}
12 impl<'a, T: ?Sized> Captures<'a> for T {}
14 type Foo<'a, 'b> = impl std::fmt::Debug + Captures<'a> + Captures<'b>;
16 fn foo<'x, 'y>(i: &'x i32, j: &'y i32) -> (Foo<'x, 'y>, Foo<'y, 'x>) {
21 println!("{}", <X<_, _> as ToString>::to_string(&f(42_i32, String::new()).1));
24 println!("{:?}", foo(&meh, &muh));