about summary refs log tree commit diff
path: root/tests/rustdoc/inline_cross
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rustdoc/inline_cross')
-rw-r--r--tests/rustdoc/inline_cross/assoc-const-equality.rs1
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/issue-85454.rs17
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/reexport-with-anonymous-lifetime-98697.rs17
-rw-r--r--tests/rustdoc/inline_cross/issue-76736-2.rs6
-rw-r--r--tests/rustdoc/inline_cross/issue-76736-4.rs19
-rw-r--r--tests/rustdoc/inline_cross/qpath-self-85454.rs30
-rw-r--r--tests/rustdoc/inline_cross/reexport-with-anonymous-lifetime-98697.rs18
7 files changed, 106 insertions, 2 deletions
diff --git a/tests/rustdoc/inline_cross/assoc-const-equality.rs b/tests/rustdoc/inline_cross/assoc-const-equality.rs
index 89ed808de62..cdf74389e76 100644
--- a/tests/rustdoc/inline_cross/assoc-const-equality.rs
+++ b/tests/rustdoc/inline_cross/assoc-const-equality.rs
@@ -1,5 +1,6 @@
 //@ aux-crate:assoc_const_equality=assoc-const-equality.rs
 //@ edition:2021
+//@ ignore-test (FIXME: #125092)
 
 #![crate_name = "user"]
 
diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-85454.rs b/tests/rustdoc/inline_cross/auxiliary/issue-85454.rs
new file mode 100644
index 00000000000..5db4fe053af
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/issue-85454.rs
@@ -0,0 +1,17 @@
+// @has issue_85454/trait.FromResidual.html
+// @has - '//pre[@class="rust item-decl"]' 'pub trait FromResidual<R = <Self as Try>::Residual> { fn from_residual(residual: R) -> Self; }'
+pub trait FromResidual<R = <Self as Try>::Residual> {
+    fn from_residual(residual: R) -> Self;
+}
+
+pub trait Try: FromResidual {
+    type Output;
+    type Residual;
+    fn from_output(output: Self::Output) -> Self;
+    fn branch(self) -> ControlFlow<Self::Residual, Self::Output>;
+}
+
+pub enum ControlFlow<B, C = ()> {
+    Continue(C),
+    Break(B),
+}
diff --git a/tests/rustdoc/inline_cross/auxiliary/reexport-with-anonymous-lifetime-98697.rs b/tests/rustdoc/inline_cross/auxiliary/reexport-with-anonymous-lifetime-98697.rs
new file mode 100644
index 00000000000..4e55e7ed576
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/reexport-with-anonymous-lifetime-98697.rs
@@ -0,0 +1,17 @@
+/// When reexporting this function, make sure the anonymous lifetimes are not rendered.
+///
+/// https://github.com/rust-lang/rust/issues/98697
+pub fn repro<F>()
+where
+    F: Fn(&str),
+{
+    unimplemented!()
+}
+
+pub struct Extra;
+
+pub trait MyTrait<T> {
+    fn run() {}
+}
+
+impl MyTrait<&Extra> for Extra {}
diff --git a/tests/rustdoc/inline_cross/issue-76736-2.rs b/tests/rustdoc/inline_cross/issue-76736-2.rs
index 83529dd1887..d4e6a697fc8 100644
--- a/tests/rustdoc/inline_cross/issue-76736-2.rs
+++ b/tests/rustdoc/inline_cross/issue-76736-2.rs
@@ -1,6 +1,8 @@
 //@ aux-build:issue-76736-1.rs
 //@ aux-build:issue-76736-2.rs
 
+// https://github.com/rust-lang/rust/issues/124635
+
 #![crate_name = "foo"]
 #![feature(rustc_private)]
 
@@ -8,9 +10,9 @@ extern crate issue_76736_1;
 extern crate issue_76736_2;
 
 // @has foo/struct.Foo.html
-// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
+// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
 pub struct Foo;
 
 // @has foo/struct.Bar.html
-// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
+// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
 pub use issue_76736_2::Bar;
diff --git a/tests/rustdoc/inline_cross/issue-76736-4.rs b/tests/rustdoc/inline_cross/issue-76736-4.rs
new file mode 100644
index 00000000000..297657ef9de
--- /dev/null
+++ b/tests/rustdoc/inline_cross/issue-76736-4.rs
@@ -0,0 +1,19 @@
+//@ aux-build:issue-76736-1.rs
+//@ aux-build:issue-76736-2.rs
+
+// https://github.com/rust-lang/rust/issues/124635
+
+#![crate_name = "foo"]
+#![feature(rustc_private, staged_api)]
+#![unstable(feature = "rustc_private", issue = "none")]
+
+extern crate issue_76736_1;
+extern crate issue_76736_2;
+
+// @has foo/struct.Foo.html
+// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
+pub struct Foo;
+
+// @has foo/struct.Bar.html
+// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult'
+pub use issue_76736_2::Bar;
diff --git a/tests/rustdoc/inline_cross/qpath-self-85454.rs b/tests/rustdoc/inline_cross/qpath-self-85454.rs
new file mode 100644
index 00000000000..de806db7709
--- /dev/null
+++ b/tests/rustdoc/inline_cross/qpath-self-85454.rs
@@ -0,0 +1,30 @@
+//@ aux-build:issue-85454.rs
+//@ build-aux-docs
+#![crate_name = "foo"]
+// https://github.com/rust-lang/rust/issues/85454
+
+extern crate issue_85454;
+
+// @has foo/trait.FromResidual.html
+// @has - '//pre[@class="rust item-decl"]' 'pub trait FromResidual<R = <Self as Try>::Residual> { // Required method fn from_residual(residual: R) -> Self; }'
+pub trait FromResidual<R = <Self as Try>::Residual> {
+    fn from_residual(residual: R) -> Self;
+}
+
+pub trait Try: FromResidual {
+    type Output;
+    type Residual;
+    fn from_output(output: Self::Output) -> Self;
+    fn branch(self) -> ControlFlow<Self::Residual, Self::Output>;
+}
+
+pub enum ControlFlow<B, C = ()> {
+    Continue(C),
+    Break(B),
+}
+
+pub mod reexport {
+    // @has foo/reexport/trait.FromResidual.html
+    // @has - '//pre[@class="rust item-decl"]' 'pub trait FromResidual<R = <Self as Try>::Residual> { // Required method fn from_residual(residual: R) -> Self; }'
+    pub use issue_85454::*;
+}
diff --git a/tests/rustdoc/inline_cross/reexport-with-anonymous-lifetime-98697.rs b/tests/rustdoc/inline_cross/reexport-with-anonymous-lifetime-98697.rs
new file mode 100644
index 00000000000..fe6e5a39c81
--- /dev/null
+++ b/tests/rustdoc/inline_cross/reexport-with-anonymous-lifetime-98697.rs
@@ -0,0 +1,18 @@
+//@ aux-build:reexport-with-anonymous-lifetime-98697.rs
+//@ ignore-cross-compile
+#![crate_name = "foo"]
+
+// When reexporting a function with a HRTB with anonymous lifetimes,
+// make sure the anonymous lifetimes are not rendered.
+//
+// https://github.com/rust-lang/rust/issues/98697
+
+extern crate reexport_with_anonymous_lifetime_98697;
+
+// @has foo/fn.repro.html '//pre[@class="rust item-decl"]/code' 'fn repro<F>()where F: Fn(&str)'
+// @!has foo/fn.repro.html '//pre[@class="rust item-decl"]/code' 'for<'
+pub use reexport_with_anonymous_lifetime_98697::repro;
+
+// @has foo/struct.Extra.html '//div[@id="trait-implementations-list"]//h3[@class="code-header"]' 'impl MyTrait<&Extra> for Extra'
+// @!has foo/struct.Extra.html '//div[@id="trait-implementations-list"]//h3[@class="code-header"]' 'impl<'
+pub use reexport_with_anonymous_lifetime_98697::Extra;