2019-11-03 18:00:00 -06:00
|
|
|
//@ check-pass
|
2018-08-31 08:02:01 -05:00
|
|
|
#![allow(type_alias_bounds)]
|
|
|
|
|
2015-03-22 15:13:15 -05:00
|
|
|
//@ pretty-expanded FIXME #23616
|
|
|
|
|
2015-03-31 18:58:01 -05:00
|
|
|
use std::marker::PhantomData;
|
2015-02-21 00:37:30 -06:00
|
|
|
|
|
|
|
pub struct Handle<T, I>(T, I);
|
|
|
|
|
|
|
|
impl<T, I> Handle<T, I> {
|
|
|
|
pub fn get_info(&self) -> &I {
|
|
|
|
let Handle(_, ref info) = *self;
|
|
|
|
info
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct BufferHandle<D: Device, T> {
|
|
|
|
raw: RawBufferHandle<D>,
|
|
|
|
_marker: PhantomData<T>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<D: Device, T> BufferHandle<D, T> {
|
|
|
|
pub fn get_info(&self) -> &String {
|
|
|
|
self.raw.get_info()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub type RawBufferHandle<D: Device> = Handle<<D as Device>::Buffer, String>;
|
|
|
|
|
2015-03-31 18:58:01 -05:00
|
|
|
pub trait Device {
|
2015-02-21 00:37:30 -06:00
|
|
|
type Buffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|