// build-pass (FIXME(62277): could be check-pass?) #![feature(associated_type_bounds)] use std::iter::Once; use std::ops::Range; pub trait Three { type A; type B; type C; } pub fn assert_three() {} pub fn assert_iterator() {} pub fn assert_copy() {} pub fn assert_static() {} pub fn assert_send() {} pub fn assert_forall_into Into<&'a u8>>() {} struct A; struct B; impl<'a> Into<&'a u8> for A { fn into(self) -> &'a u8 { &0 } } impl Three for B { type A = Range; type B = Range; type C = Range; } trait Case1 where A: Iterator, B: Iterator, C: Iterator, D: Iterator Into<&'a u8>>, E: Three, B: Iterator, C: Iterator>, Self: Three, { fn _a() { assert_iterator::(); assert_copy::(); } fn _b() { assert_iterator::(); assert_static::(); } fn _c() { assert_iterator::(); assert_copy::(); assert_static::(); assert_send::(); } fn _d() { assert_iterator::(); assert_forall_into::(); } fn _e() { assert_three::(); assert_iterator::(); assert_iterator::(); assert_iterator::(); assert_copy::<::Item>(); assert_copy::<::Item>(); assert_copy::<::Item>(); } fn _self() { assert_three::(); assert_copy::(); assert_static::(); assert_send::(); } } struct DataCase1; impl Three for DataCase1 { type A = u8; type B = u8; type C = u8; } impl Case1, Range, Range, Once, B> for DataCase1 {} trait Case2< A: Iterator, B: Iterator, C: Iterator, D: Iterator Into<&'a u8>>, E: Three, B: Iterator, C: Iterator>, >: Three { fn _a() { assert_iterator::(); assert_copy::(); } fn _b() { assert_iterator::(); assert_static::(); } fn _c() { assert_iterator::(); assert_copy::(); assert_static::(); assert_send::(); } fn _d() { assert_iterator::(); assert_forall_into::(); } fn _e() { assert_three::(); assert_iterator::(); assert_iterator::(); assert_iterator::(); assert_copy::<::Item>(); assert_copy::<::Item>(); assert_copy::<::Item>(); } fn _self() { assert_three::(); assert_copy::(); assert_static::(); assert_send::(); } } struct DataCase2; impl Three for DataCase2 { type A = u8; type B = u8; type C = u8; } impl Case2, Range, Range, Once, B> for DataCase2 {} fn main() {}