2 // Test case where an associated type is referenced from within the
3 // supertrait definition. Issue #20220.
6 use std::vec::IntoIter;
8 pub trait Foo: Iterator<Item=<Self as Foo>::Key> {
12 impl Foo for IntoIter<i32> {
16 fn sum_foo<F:Foo<Key=i32>>(f: F) -> i32 {
17 f.fold(0, |a,b| a + b)
21 let x = sum_foo(vec![11, 10, 1].into_iter());