summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/issue-92292.rs
blob: bb3700a2b5e94f711055fa715d58319733c24ad5 (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
// check-pass

use std::marker::PhantomData;

pub struct MyGenericType<T> {
    _marker: PhantomData<*const T>,
}

pub struct MyNonGenericType;

impl<T> From<MyGenericType<T>> for MyNonGenericType {
    fn from(_: MyGenericType<T>) -> Self {
        todo!()
    }
}

pub trait MyTrait {
    const MY_CONSTANT: i32;
}

impl<T> MyTrait for MyGenericType<T>
where
    Self: Into<MyNonGenericType>,
{
    const MY_CONSTANT: i32 = 1;
}

impl<T> MyGenericType<T> {
    const MY_OTHER_CONSTANT: i32 = <MyGenericType<T> as MyTrait>::MY_CONSTANT;
}

fn main() {}