about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-03-20 15:58:34 +0000
committerbors <bors@rust-lang.org>2020-03-20 15:58:34 +0000
commit2835ca65845c5fac8da2a2612a06b12ad2f4c77c (patch)
treecea22dab1002cfa28d197895ba3958c75d6a1186 /src/test
parentf4c675c476c18b1a11041193f2f59d695b126bc8 (diff)
parent43c7a503fe7073c83a92b65c59de8cb820cf3b97 (diff)
downloadrust-2835ca65845c5fac8da2a2612a06b12ad2f4c77c.tar.gz
rust-2835ca65845c5fac8da2a2612a06b12ad2f4c77c.zip
Auto merge of #70174 - JohnTitor:rollup-0lum0jh, r=JohnTitor
Rollup of 9 pull requests

Successful merges:

 - #69618 (Clarify the relationship between `forget()` and `ManuallyDrop`.)
 - #69768 (Compute the correct layout for variants of uninhabited enums)
 - #69935 (codegen/mir: support polymorphic `InstanceDef`s)
 - #70103 (Clean up E0437 explanation)
 - #70131 (Add regression test for TAIT lifetime inference (issue #55099))
 - #70133 (remove unused imports)
 - #70145 (doc: Add quote to .init_array)
 - #70146 (Clean up e0438 explanation)
 - #70150 (triagebot.toml: accept cleanup-crew)

Failed merges:

r? @ghost
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/test/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs b/src/test/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs
new file mode 100644
index 00000000000..8e8508cdd6f
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs
@@ -0,0 +1,28 @@
+// check-pass
+// Regression test for issue #55099
+// Tests that we don't incorrectly consider a lifetime to part
+// of the concrete type
+
+#![feature(type_alias_impl_trait)]
+
+trait Future {
+}
+
+struct AndThen<F>(F);
+
+impl<F> Future for AndThen<F> {
+}
+
+struct Foo<'a> {
+    x: &'a mut (),
+}
+
+type F = impl Future;
+
+impl<'a> Foo<'a> {
+    fn reply(&mut self) -> F {
+        AndThen(|| ())
+    }
+}
+
+fn main() {}