summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/issues/issue-93788.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/impl-trait/issues/issue-93788.rs')
-rw-r--r--tests/ui/impl-trait/issues/issue-93788.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/issues/issue-93788.rs b/tests/ui/impl-trait/issues/issue-93788.rs
new file mode 100644
index 000000000..6924931cd
--- /dev/null
+++ b/tests/ui/impl-trait/issues/issue-93788.rs
@@ -0,0 +1,27 @@
+// check-pass
+
+struct D;
+
+trait Tr {
+ type It;
+ fn foo(self) -> Option<Self::It>;
+}
+
+impl<'a> Tr for &'a D {
+ type It = ();
+ fn foo(self) -> Option<()> { None }
+}
+
+fn run<F>(f: F)
+ where for<'a> &'a D: Tr,
+ F: Fn(<&D as Tr>::It),
+{
+ let d = &D;
+ while let Some(i) = d.foo() {
+ f(i);
+ }
+}
+
+fn main() {
+ run(|_| {});
+}