mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 00:03:43 +00:00
21 lines
312 B
Rust
21 lines
312 B
Rust
// run-pass
|
|
trait Device {
|
|
type Resources;
|
|
}
|
|
#[allow(unused_tuple_struct_fields)]
|
|
struct Foo<D, R>(D, R);
|
|
|
|
impl<D: Device> Foo<D, D::Resources> {
|
|
fn present(&self) {}
|
|
}
|
|
|
|
struct Res;
|
|
struct Dev;
|
|
|
|
impl Device for Dev { type Resources = Res; }
|
|
|
|
fn main() {
|
|
let foo = Foo(Dev, Res);
|
|
foo.present();
|
|
}
|