summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/assoc-type-in-superbad.rs
blob: 65340b2a2092ff5cdf345a4c08703603d70c0ee1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Test case where an associated type is referenced from within the
// supertrait definition, and the impl makes the wrong
// associations. Issue #20220.

use std::vec::IntoIter;

pub trait Foo: Iterator<Item = <Self as Foo>::Key> {
    type Key;
}

impl Foo for IntoIter<i32> {
    type Key = u32;
    //~^ ERROR expected `IntoIter<i32>` to be an iterator that yields `u32`, but it yields `i32`
}

fn main() {}