3 #![feature(associated_type_bounds)]
4 #![feature(type_alias_impl_trait)]
10 fn mk(self) -> Self::As1;
13 fn tr2(self) -> &'a Self;
16 fn assert_copy<T: Copy>(x: T) {
20 fn assert_static<T: 'static>(_: T) {}
21 fn assert_forall_tr2<T: for<'a> Tr2<'a>>(_: T) {}
24 #[derive(Copy, Clone)]
28 fn mk(self) -> Self::As1 {
33 type Et1 = impl Tr1<As1: Copy>;
38 assert_copy(def_et1().mk());
41 type Et2 = impl Tr1<As1: 'static>;
46 assert_static(def_et2().mk());
49 type Et3 = impl Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>>>>;
53 type As1 = core::ops::Range<u8>;
54 fn mk(self) -> Self::As1 {
61 let _0 = def_et3().mk().clone();
67 assert_eq!(s, (0..10).map(|x| x + 1).sum());
70 type Et4 = impl Tr1<As1: for<'a> Tr2<'a>>;
72 #[derive(Copy, Clone)]
80 impl<'a> Tr2<'a> for A {
81 fn tr2(self) -> &'a Self {
88 assert_forall_tr2(def_et4().mk());