rust/tests/ui/issues/issue-22356.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
614 B
Rust
Raw Normal View History

//@ check-pass
#![allow(type_alias_bounds)]
//@ pretty-expanded FIXME #23616
2015-03-31 23:58:01 +00:00
use std::marker::PhantomData;
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 23:58:01 +00:00
pub trait Device {
type Buffer;
}
fn main() {}