]> git.proxmox.com Git - rustc.git/blob - src/test/ui/impl-trait/projection.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / impl-trait / projection.rs
1 // build-pass
2 // needs to be build-pass, because it is a regression test for a mir validation failure
3 // that only happens during codegen.
4
5 struct D;
6
7 trait Tr {
8 type It;
9 fn foo(self) -> Option<Self::It>;
10 }
11
12 impl<'a> Tr for &'a D {
13 type It = ();
14 fn foo(self) -> Option<()> { None }
15 }
16
17 fn run<F>(f: F)
18 where for<'a> &'a D: Tr,
19 F: Fn(<&D as Tr>::It),
20 {
21 let d = &D;
22 while let Some(i) = d.foo() {
23 f(i);
24 }
25 }
26
27 fn main() {
28 run(|_| {});
29 }