2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2015-06-13 15:34:03 -05:00
|
|
|
trait Device {
|
|
|
|
type Resources;
|
|
|
|
}
|
2022-07-25 15:36:03 -05:00
|
|
|
#[allow(unused_tuple_struct_fields)]
|
2015-06-13 15:34:03 -05:00
|
|
|
struct Foo<D, R>(D, R);
|
|
|
|
|
2015-06-13 18:27:18 -05:00
|
|
|
impl<D: Device> Foo<D, D::Resources> {
|
2015-06-13 15:34:03 -05:00
|
|
|
fn present(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Res;
|
|
|
|
struct Dev;
|
|
|
|
|
|
|
|
impl Device for Dev { type Resources = Res; }
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let foo = Foo(Dev, Res);
|
|
|
|
foo.present();
|
|
|
|
}
|