]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/issue-92292.rs
Add 'compiler/rustc_smir/' from commit '9abcb5c7b574cf316eb23d3f469187bb86ba3019'
[rust.git] / src / test / ui / traits / issue-92292.rs
1 // check-pass
2
3 use std::marker::PhantomData;
4
5 pub struct MyGenericType<T> {
6     _marker: PhantomData<*const T>,
7 }
8
9 pub struct MyNonGenericType;
10
11 impl<T> From<MyGenericType<T>> for MyNonGenericType {
12     fn from(_: MyGenericType<T>) -> Self {
13         todo!()
14     }
15 }
16
17 pub trait MyTrait {
18     const MY_CONSTANT: i32;
19 }
20
21 impl<T> MyTrait for MyGenericType<T>
22 where
23     Self: Into<MyNonGenericType>,
24 {
25     const MY_CONSTANT: i32 = 1;
26 }
27
28 impl<T> MyGenericType<T> {
29     const MY_OTHER_CONSTANT: i32 = <MyGenericType<T> as MyTrait>::MY_CONSTANT;
30 }
31
32 fn main() {}