]>
Commit | Line | Data |
---|---|---|
d9bb1a4e | 1 | // check-pass |
0bf4aa26 | 2 | #![allow(dead_code)] |
54a0048b SL |
3 | trait Make { |
4 | type Out; | |
5 | ||
6 | fn make() -> Self::Out; | |
7 | } | |
8 | ||
9 | impl Make for () { | |
10 | type Out = (); | |
11 | ||
12 | fn make() -> Self::Out {} | |
13 | } | |
14 | ||
15 | // Also make sure we don't hit an ICE when the projection can't be known | |
16 | fn f<T: Make>() -> <T as Make>::Out { loop {} } | |
17 | ||
18 | // ...and that it works with a blanket impl | |
19 | trait Tr { | |
20 | type Assoc; | |
21 | } | |
22 | ||
23 | impl<T: Make> Tr for T { | |
24 | type Assoc = (); | |
25 | } | |
26 | ||
27 | fn g<T: Make>() -> <T as Tr>::Assoc { } | |
28 | ||
29 | fn main() {} |