]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/associated-types-method.rs
feat(rustdoc): open sidebar menu when links inside it are focused
[rust.git] / src / test / ui / associated-types / associated-types-method.rs
1 // run-pass
2 // Test that methods whose impl-trait-ref contains associated types
3 // are supported.
4
5 trait Device {
6     type Resources;
7 }
8 struct Foo<D, R>(D, R);
9
10 trait Tr {
11     fn present(&self) {}
12 }
13
14 impl<D: Device> Tr for Foo<D, D::Resources> {
15     fn present(&self) {}
16 }
17
18 struct Res;
19 struct Dev;
20 impl Device for Dev {
21     type Resources = Res;
22 }
23
24 fn main() {
25     let foo = Foo(Dev, Res);
26     foo.present();
27 }