summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/issues/issue-89312.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/impl-trait/issues/issue-89312.rs')
-rw-r--r--tests/ui/impl-trait/issues/issue-89312.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/issues/issue-89312.rs b/tests/ui/impl-trait/issues/issue-89312.rs
new file mode 100644
index 000000000..d685a6f12
--- /dev/null
+++ b/tests/ui/impl-trait/issues/issue-89312.rs
@@ -0,0 +1,24 @@
+#![feature(type_alias_impl_trait)]
+
+// check-pass
+
+trait T { type Item; }
+
+type Alias<'a> = impl T<Item = &'a ()>;
+
+struct S;
+impl<'a> T for &'a S {
+ type Item = &'a ();
+}
+
+fn filter_positive<'a>() -> Alias<'a> {
+ &S
+}
+
+fn with_positive(fun: impl Fn(Alias<'_>)) {
+ fun(filter_positive());
+}
+
+fn main() {
+ with_positive(|_| ());
+}