]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/associated-types-eq-2.rs
Rollup merge of #105567 - TimNN:kcfi16, r=nikic
[rust.git] / src / test / ui / associated-types / associated-types-eq-2.rs
1 // Test equality constraints on associated types. Check we get an error when an
2 // equality constraint is used in a qualified path.
3
4 pub trait Foo {
5     type A;
6     fn boo(&self) -> <Self as Foo>::A;
7 }
8
9 struct Bar;
10
11 impl Foo for isize {
12     type A = usize;
13     fn boo(&self) -> usize { 42 }
14 }
15
16 fn baz<I: Foo>(x: &<I as Foo<A=Bar>>::A) {}
17 //~^ ERROR associated type bindings are not allowed here
18
19 pub fn main() {}