diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-22356.rs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-22356.rs b/src/test/ui/issues/issue-22356.rs new file mode 100644 index 000000000..47fad3bb9 --- /dev/null +++ b/src/test/ui/issues/issue-22356.rs @@ -0,0 +1,34 @@ +// check-pass +#![allow(type_alias_bounds)] + +// pretty-expanded FIXME #23616 + +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>; + +pub trait Device { + type Buffer; +} + +fn main() {} |