]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/associated-types-eq-obj.rs
feat(rustdoc): open sidebar menu when links inside it are focused
[rust.git] / src / test / ui / associated-types / associated-types-eq-obj.rs
1 // run-pass
2 // Test equality constraints on associated types inside of an object type
3
4 // pretty-expanded FIXME #23616
5
6 pub trait Foo {
7     type A;
8     fn boo(&self) -> <Self as Foo>::A;
9 }
10
11 pub struct Bar;
12
13 impl Foo for char {
14     type A = Bar;
15     fn boo(&self) -> Bar { Bar }
16 }
17
18 fn baz(x: &dyn Foo<A=Bar>) -> Bar {
19     x.boo()
20 }
21
22 pub fn main() {
23     let a = 'a';
24     baz(&a);
25 }