summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-47511.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/issues/issue-47511.rs')
-rw-r--r--src/test/ui/issues/issue-47511.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-47511.rs b/src/test/ui/issues/issue-47511.rs
new file mode 100644
index 000000000..eb4860e75
--- /dev/null
+++ b/src/test/ui/issues/issue-47511.rs
@@ -0,0 +1,26 @@
+// check-fail
+// known-bug: #47511
+
+// Regression test for #47511: anonymous lifetimes can appear
+// unconstrained in a return type, but only if they appear just once
+// in the input, as the input to a projection.
+
+fn f(_: X) -> X {
+ unimplemented!()
+}
+
+fn g<'a>(_: X<'a>) -> X<'a> {
+ unimplemented!()
+}
+
+type X<'a> = <&'a () as Trait>::Value;
+
+trait Trait {
+ type Value;
+}
+
+impl<'a> Trait for &'a () {
+ type Value = ();
+}
+
+fn main() {}