]> git.proxmox.com Git - rustc.git/blob - tests/ui/associated-types/associated-types-method.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / 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 #[allow(unused_tuple_struct_fields)]
9 struct Foo<D, R>(D, R);
10
11 trait Tr {
12 fn present(&self) {}
13 }
14
15 impl<D: Device> Tr for Foo<D, D::Resources> {
16 fn present(&self) {}
17 }
18
19 struct Res;
20 struct Dev;
21 impl Device for Dev {
22 type Resources = Res;
23 }
24
25 fn main() {
26 let foo = Foo(Dev, Res);
27 foo.present();
28 }