about summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-06-15 04:10:24 +0000
committerbors <bors@rust-lang.org>2020-06-15 04:10:24 +0000
commitce6d3a73b514e9649e57cee812ad129bb2112016 (patch)
tree39b78deb20d2b50a0eaec85d605bb015e6cfa35a /src/test/rustdoc
parent4fb54ed484e2239a3e9eff3be17df00d2a162be3 (diff)
parent8b10d42ebe7843bcaed58dcbbc8836a0f27b54c9 (diff)
downloadrust-ce6d3a73b514e9649e57cee812ad129bb2112016.tar.gz
rust-ce6d3a73b514e9649e57cee812ad129bb2112016.zip
Auto merge of #72080 - matthewjasper:uniform-impl-trait, r=nikomatsakis
Clean up type alias impl trait implementation

- Removes special case for top-level impl trait
- Removes associated opaque types
- Forbid lifetime elision in let position impl trait. This is consistent with the behavior for inferred types.
- Handle lifetimes in type alias impl trait more uniformly with other parameters

cc #69323
cc #63063
Closes #57188
Closes #62988
Closes #69136
Closes #73061
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/auxiliary/issue-73061.rs17
-rw-r--r--src/test/rustdoc/issue-73061-cross-crate-opaque-assoc-type.rs14
2 files changed, 31 insertions, 0 deletions
diff --git a/src/test/rustdoc/auxiliary/issue-73061.rs b/src/test/rustdoc/auxiliary/issue-73061.rs
new file mode 100644
index 00000000000..e05a3bc6d91
--- /dev/null
+++ b/src/test/rustdoc/auxiliary/issue-73061.rs
@@ -0,0 +1,17 @@
+//edition:2018
+
+#![feature(type_alias_impl_trait)]
+
+pub trait Foo {
+    type X: std::future::Future<Output = ()>;
+    fn x(&self) -> Self::X;
+}
+
+pub struct F;
+
+impl Foo for F {
+    type X = impl std::future::Future<Output = ()>;
+    fn x(&self) -> Self::X {
+        async {}
+    }
+}
diff --git a/src/test/rustdoc/issue-73061-cross-crate-opaque-assoc-type.rs b/src/test/rustdoc/issue-73061-cross-crate-opaque-assoc-type.rs
new file mode 100644
index 00000000000..2700f2370ee
--- /dev/null
+++ b/src/test/rustdoc/issue-73061-cross-crate-opaque-assoc-type.rs
@@ -0,0 +1,14 @@
+// Regression test for ICE #73061
+
+// aux-build:issue-73061.rs
+
+extern crate issue_73061;
+
+pub struct Z;
+
+impl issue_73061::Foo for Z {
+    type X = <issue_73061::F as issue_73061::Foo>::X;
+    fn x(&self) -> Self::X {
+        issue_73061::F.x()
+    }
+}