summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-22356.rs
blob: 47fad3bb909e5d15673c17495a12ba960a8a5434 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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() {}