We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6596e9d commit 3cce66cCopy full SHA for 3cce66c
src/test/ui/impl-trait/issues/issue-93788.rs
@@ -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