We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b27c22d commit fa4f18bCopy full SHA for fa4f18b
tests/ui/traits/assoc-type-hrtb-normalization-30472.rs
@@ -0,0 +1,32 @@
1
+//@ check-pass
2
+//! Tests that associated type projections normalize properly in the presence of HRTBs.
3
+//! Original issue: <https://github.com/rust-lang/rust/issues/30472>
4
+
5
6
+pub trait MyFrom<T> {}
7
+impl<T> MyFrom<T> for T {}
8
9
+pub trait MyInto<T> {}
10
+impl<T, U> MyInto<U> for T where U: MyFrom<T> {}
11
12
13
+pub trait A<'self_> {
14
+ type T;
15
+}
16
+pub trait B: for<'self_> A<'self_> {
17
+ // Originally caused the `type U = usize` example below to fail with a type mismatch error
18
+ type U: for<'self_> MyFrom<<Self as A<'self_>>::T>;
19
20
21
22
+pub struct M;
23
+impl<'self_> A<'self_> for M {
24
+ type T = usize;
25
26
27
+impl B for M {
28
+ type U = usize;
29
30
31
32
+fn main() {}
0 commit comments