We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 78fd0f6 commit 12b59b4Copy full SHA for 12b59b4
src/test/ui/traits/issue-92292.rs
@@ -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