Skip to content

Commit 12b59b4

Browse files
committed
Add UI test for rust-lang#92292
Closes rust-lang#92292
1 parent 78fd0f6 commit 12b59b4

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Diff for: src/test/ui/traits/issue-92292.rs

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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() {}

0 commit comments

Comments
 (0)