Skip to content

Commit 3cce66c

Browse files
committed
Add another regression test
1 parent 6596e9d commit 3cce66c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// check-pass
2+
3+
struct D;
4+
5+
trait Tr {
6+
type It;
7+
fn foo(self) -> Option<Self::It>;
8+
}
9+
10+
impl<'a> Tr for &'a D {
11+
type It = ();
12+
fn foo(self) -> Option<()> { None }
13+
}
14+
15+
fn run<F>(f: F)
16+
where for<'a> &'a D: Tr,
17+
F: Fn(<&D as Tr>::It),
18+
{
19+
let d = &D;
20+
while let Some(i) = d.foo() {
21+
f(i);
22+
}
23+
}
24+
25+
fn main() {
26+
run(|_| {});
27+
}

0 commit comments

Comments
 (0)