]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-31597.rs
New upstream version 1.49.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-31597.rs
CommitLineData
d9bb1a4e 1// check-pass
0bf4aa26 2#![allow(dead_code)]
54a0048b
SL
3trait Make {
4 type Out;
5
6 fn make() -> Self::Out;
7}
8
9impl 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
16fn f<T: Make>() -> <T as Make>::Out { loop {} }
17
18// ...and that it works with a blanket impl
19trait Tr {
20 type Assoc;
21}
22
23impl<T: Make> Tr for T {
24 type Assoc = ();
25}
26
27fn g<T: Make>() -> <T as Tr>::Assoc { }
28
29fn main() {}