Skip to content

Commit fa4f18b

Browse files
committed
Add test for issue 30472
1 parent b27c22d commit fa4f18b

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
pubtraitMyFrom<T>{}
7+
impl<T>MyFrom<T>forT{}
8+
9+
pubtraitMyInto<T>{}
10+
impl<T,U>MyInto<U>forTwhereU:MyFrom<T>{}
11+
12+
13+
pubtraitA<'self_>{
14+
typeT;
15+
}
16+
pubtraitB:for<'self_>A<'self_>{
17+
// Originally caused the `type U = usize` example below to fail with a type mismatch error
18+
typeU:for<'self_>MyFrom<<SelfasA<'self_>>::T>;
19+
}
20+
21+
22+
pubstructM;
23+
impl<'self_>A<'self_>forM{
24+
typeT = usize;
25+
}
26+
27+
implBforM{
28+
typeU = usize;
29+
}
30+
31+
32+
fnmain(){}

0 commit comments

Comments
 (0)