]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/assoc-type-in-superbad.rs
:arrow_up: rust-analyzer
[rust.git] / src / test / ui / traits / assoc-type-in-superbad.rs
1 // Test case where an associated type is referenced from within the
2 // supertrait definition, and the impl makes the wrong
3 // associations. Issue #20220.
4
5 use std::vec::IntoIter;
6
7 pub trait Foo: Iterator<Item = <Self as Foo>::Key> {
8     type Key;
9 }
10
11 impl Foo for IntoIter<i32> {
12     type Key = u32;
13     //~^ ERROR expected `std::vec::IntoIter<i32>` to be an iterator that yields `u32`, but it yields `i32`
14 }
15
16 fn main() {}