summaryrefslogtreecommitdiffstats
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/add-docs.rs9
-rw-r--r--tests/rustdoc/inline_cross/assoc-items.rs42
-rw-r--r--tests/rustdoc/inline_cross/assoc_item_trait_bounds.out0.html1
-rw-r--r--tests/rustdoc/inline_cross/assoc_item_trait_bounds.out2.html1
-rw-r--r--tests/rustdoc/inline_cross/assoc_item_trait_bounds.out9.html1
-rw-r--r--tests/rustdoc/inline_cross/assoc_item_trait_bounds.rs44
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/add-docs.rs4
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/assoc-items.rs38
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/assoc_item_trait_bounds.rs46
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/cross-glob.rs7
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/default-trait-method.rs16
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/dyn_trait.rs17
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/impl-inline-without-trait.rs8
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs41
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/implementors_inline.rs18
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/issue-24183.rs14
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/issue-33113.rs7
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/macro-vis.rs25
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/macros.rs10
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/proc_macro.rs47
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/renamed-via-module.rs9
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/rustdoc-hidden-sig.rs12
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/rustdoc-hidden.rs4
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/rustdoc-nonreachable-impls.rs34
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/rustdoc-trait-object-impl.rs13
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/trait-vis.rs13
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/use_crate.rs5
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/use_crate_2.rs1
-rw-r--r--tests/rustdoc/inline_cross/cross-glob.rs16
-rw-r--r--tests/rustdoc/inline_cross/default-trait-method.rs20
-rw-r--r--tests/rustdoc/inline_cross/dyn_trait.rs31
-rw-r--r--tests/rustdoc/inline_cross/hidden-use.rs12
-rw-r--r--tests/rustdoc/inline_cross/impl-inline-without-trait.rs12
-rw-r--r--tests/rustdoc/inline_cross/impl_trait.rs47
-rw-r--r--tests/rustdoc/inline_cross/implementors-js.rs25
-rw-r--r--tests/rustdoc/inline_cross/inline_hidden.rs12
-rw-r--r--tests/rustdoc/inline_cross/issue-24183.method_no_where_self_sized.html1
-rw-r--r--tests/rustdoc/inline_cross/issue-24183.rs18
-rw-r--r--tests/rustdoc/inline_cross/issue-28480.rs13
-rw-r--r--tests/rustdoc/inline_cross/issue-31948-1.rs27
-rw-r--r--tests/rustdoc/inline_cross/issue-31948-2.rs21
-rw-r--r--tests/rustdoc/inline_cross/issue-31948.rs29
-rw-r--r--tests/rustdoc/inline_cross/issue-32881.rs11
-rw-r--r--tests/rustdoc/inline_cross/issue-33113.rs10
-rw-r--r--tests/rustdoc/inline_cross/macro-vis.rs36
-rw-r--r--tests/rustdoc/inline_cross/macros.rs19
-rw-r--r--tests/rustdoc/inline_cross/proc_macro.rs36
-rw-r--r--tests/rustdoc/inline_cross/renamed-via-module.rs24
-rw-r--r--tests/rustdoc/inline_cross/trait-vis.rs7
-rw-r--r--tests/rustdoc/inline_cross/use_crate.rs27
50 files changed, 941 insertions, 0 deletions
diff --git a/tests/rustdoc/inline_cross/add-docs.rs b/tests/rustdoc/inline_cross/add-docs.rs
new file mode 100644
index 000000000..a1124d209
--- /dev/null
+++ b/tests/rustdoc/inline_cross/add-docs.rs
@@ -0,0 +1,9 @@
+// aux-build:add-docs.rs
+
+extern crate inner;
+
+
+// @has add_docs/struct.MyStruct.html
+// @hasraw add_docs/struct.MyStruct.html "Doc comment from ‘pub use’, Doc comment from definition"
+/// Doc comment from 'pub use',
+pub use inner::MyStruct;
diff --git a/tests/rustdoc/inline_cross/assoc-items.rs b/tests/rustdoc/inline_cross/assoc-items.rs
new file mode 100644
index 000000000..811827a17
--- /dev/null
+++ b/tests/rustdoc/inline_cross/assoc-items.rs
@@ -0,0 +1,42 @@
+// aux-build:assoc-items.rs
+// build-aux-docs
+// ignore-cross-compile
+
+#![crate_name = "foo"]
+
+extern crate assoc_items;
+
+// @has foo/struct.MyStruct.html
+// @!hasraw - 'PrivateConst'
+// @has - '//*[@id="associatedconstant.PublicConst"]' 'pub const PublicConst: u8'
+// @has - '//*[@class="docblock"]' 'docs for PublicConst'
+// @!hasraw - 'private_method'
+// @has - '//*[@id="method.public_method"]' 'pub fn public_method()'
+// @has - '//*[@class="docblock"]' 'docs for public_method'
+// @has - '//*[@id="associatedconstant.ConstNoDefault"]' 'const ConstNoDefault: i16'
+// @has - '//*[@class="docblock"]' 'dox for ConstNoDefault'
+// @has - '//*[@id="associatedconstant.ConstWithDefault"]' 'const ConstWithDefault: u16'
+// @has - '//div[@class="docblock"]' 'docs for ConstWithDefault'
+// @has - '//*[@id="associatedtype.TypeNoDefault"]' 'type TypeNoDefault = i32'
+// @has - '//*[@class="docblock"]' 'dox for TypeNoDefault'
+// @has - '//*[@id="associatedtype.TypeWithDefault"]' 'type TypeWithDefault = u32'
+// @has - '//div[@class="docblock"]' 'docs for TypeWithDefault'
+// @has - '//*[@id="method.method_no_default"]' 'fn method_no_default()'
+// @has - '//*[@class="docblock"]' 'dox for method_no_default'
+// @has - '//*[@id="method.method_with_default"]' 'fn method_with_default()'
+// @has - '//div[@class="docblock"]' 'docs for method_with_default'
+pub use assoc_items::MyStruct;
+
+// @has foo/trait.MyTrait.html
+// @has - '//*[@id="associatedconstant.ConstNoDefault"]' 'const ConstNoDefault: i16'
+// @has - '//*[@class="docblock"]' 'docs for ConstNoDefault'
+// @has - '//*[@id="associatedconstant.ConstWithDefault"]' 'const ConstWithDefault: u16'
+// @has - '//*[@class="docblock"]' 'docs for ConstWithDefault'
+// @has - '//*[@id="associatedtype.TypeNoDefault"]' 'type TypeNoDefault'
+// @has - '//*[@class="docblock"]' 'docs for TypeNoDefault'
+// @has - '//*[@class="docblock"]' 'docs for TypeWithDefault'
+// @has - '//*[@id="tymethod.method_no_default"]' 'fn method_no_default()'
+// @has - '//*[@class="docblock"]' 'docs for method_no_default'
+// @has - '//*[@id="method.method_with_default"]' 'fn method_with_default()'
+// @has - '//*[@class="docblock"]' 'docs for method_with_default'
+pub use assoc_items::MyTrait;
diff --git a/tests/rustdoc/inline_cross/assoc_item_trait_bounds.out0.html b/tests/rustdoc/inline_cross/assoc_item_trait_bounds.out0.html
new file mode 100644
index 000000000..8934bc1ee
--- /dev/null
+++ b/tests/rustdoc/inline_cross/assoc_item_trait_bounds.out0.html
@@ -0,0 +1 @@
+<h4 class="code-header">type <a href="#associatedtype.Out0" class="associatedtype">Out0</a>: <a class="trait" href="../assoc_item_trait_bounds/trait.Support.html" title="trait assoc_item_trait_bounds::Support">Support</a>&lt;Item = <a class="primitive" href="{{channel}}/std/primitive.unit.html">()</a>&gt;</h4> \ No newline at end of file
diff --git a/tests/rustdoc/inline_cross/assoc_item_trait_bounds.out2.html b/tests/rustdoc/inline_cross/assoc_item_trait_bounds.out2.html
new file mode 100644
index 000000000..bf330670e
--- /dev/null
+++ b/tests/rustdoc/inline_cross/assoc_item_trait_bounds.out2.html
@@ -0,0 +1 @@
+<h4 class="code-header">type <a href="#associatedtype.Out2" class="associatedtype">Out2</a>&lt;T&gt;: <a class="trait" href="../assoc_item_trait_bounds/trait.Support.html" title="trait assoc_item_trait_bounds::Support">Support</a>&lt;Item = T&gt;</h4> \ No newline at end of file
diff --git a/tests/rustdoc/inline_cross/assoc_item_trait_bounds.out9.html b/tests/rustdoc/inline_cross/assoc_item_trait_bounds.out9.html
new file mode 100644
index 000000000..69d84e1b2
--- /dev/null
+++ b/tests/rustdoc/inline_cross/assoc_item_trait_bounds.out9.html
@@ -0,0 +1 @@
+<h4 class="code-header">type <a href="#associatedtype.Out9" class="associatedtype">Out9</a>: <a class="trait" href="{{channel}}/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="{{channel}}/std/primitive.i32.html">i32</a>) -&gt; <a class="primitive" href="{{channel}}/std/primitive.bool.html">bool</a> + <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></h4> \ No newline at end of file
diff --git a/tests/rustdoc/inline_cross/assoc_item_trait_bounds.rs b/tests/rustdoc/inline_cross/assoc_item_trait_bounds.rs
new file mode 100644
index 000000000..db2491b87
--- /dev/null
+++ b/tests/rustdoc/inline_cross/assoc_item_trait_bounds.rs
@@ -0,0 +1,44 @@
+// Regression test for issues #77763, #84579 and #102142.
+#![crate_name = "main"]
+
+// aux-build:assoc_item_trait_bounds.rs
+// build-aux-docs
+// ignore-cross-compile
+extern crate assoc_item_trait_bounds as aux;
+
+// @has main/trait.Main.html
+// @has - '//*[@id="associatedtype.Out0"]' 'type Out0: Support<Item = ()>'
+// @has - '//*[@id="associatedtype.Out1"]' 'type Out1: Support<Item = Self::Item>'
+// @has - '//*[@id="associatedtype.Out2"]' 'type Out2<T>: Support<Item = T>'
+// @has - '//*[@id="associatedtype.Out3"]' 'type Out3: Support<Produce<()> = bool>'
+// @has - '//*[@id="associatedtype.Out4"]' 'type Out4<T>: Support<Produce<T> = T>'
+// @has - '//*[@id="associatedtype.Out5"]' "type Out5: Support<Output<'static> = &'static ()>"
+// @has - '//*[@id="associatedtype.Out6"]' "type Out6: for<'a> Support<Output<'a> = &'a ()>"
+// @has - '//*[@id="associatedtype.Out7"]' "type Out7: Support<Item = String, Produce<i32> = u32> + Unrelated"
+// @has - '//*[@id="associatedtype.Out8"]' "type Out8: Unrelated + Protocol<i16, Q1 = u128, Q0 = ()>"
+// @has - '//*[@id="associatedtype.Out9"]' "type Out9: FnMut(i32) -> bool + Clone"
+// @has - '//*[@id="associatedtype.Out10"]' "type Out10<'q>: Support<Output<'q> = ()>"
+// @has - '//*[@id="associatedtype.Out11"]' "type Out11: for<'r, 's> Helper<A<'s> = &'s (), B<'r> = ()>"
+// @has - '//*[@id="associatedtype.Out12"]' "type Out12: for<'w> Helper<B<'w> = Cow<'w, str>, A<'w> = bool>"
+// @has - '//*[@id="associatedtype.Out13"]' "type Out13: for<'fst, 'snd> Aid<'snd, Result<'fst> = &'fst mut str>"
+// @has - '//*[@id="associatedtype.Out14"]' "type Out14<P: Copy + Eq, Q: ?Sized>"
+//
+// Snapshots:
+// Check that we don't render any where-clauses for the following associated types since
+// all corresponding projection equality predicates should have already been re-sugared
+// to associated type bindings:
+//
+// @snapshot out0 - '//*[@id="associatedtype.Out0"]/*[@class="code-header"]'
+// @snapshot out2 - '//*[@id="associatedtype.Out2"]/*[@class="code-header"]'
+// @snapshot out9 - '//*[@id="associatedtype.Out9"]/*[@class="code-header"]'
+//
+// @has - '//*[@id="tymethod.make"]' \
+// "fn make<F>(_: F, _: impl FnMut(&str) -> bool)\
+// where \
+// F: FnOnce(u32) -> String, \
+// Self::Out2<()>: Protocol<u8, Q0 = Self::Item, Q1 = ()>"
+pub use aux::Main;
+
+// @has main/trait.Aid.html
+// @has - '//*[@id="associatedtype.Result"]' "type Result<'inter: 'src>"
+pub use aux::Aid;
diff --git a/tests/rustdoc/inline_cross/auxiliary/add-docs.rs b/tests/rustdoc/inline_cross/auxiliary/add-docs.rs
new file mode 100644
index 000000000..85efa508f
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/add-docs.rs
@@ -0,0 +1,4 @@
+#![crate_name = "inner"]
+
+/// Doc comment from definition
+pub struct MyStruct;
diff --git a/tests/rustdoc/inline_cross/auxiliary/assoc-items.rs b/tests/rustdoc/inline_cross/auxiliary/assoc-items.rs
new file mode 100644
index 000000000..5fa299914
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/assoc-items.rs
@@ -0,0 +1,38 @@
+#![feature(associated_type_defaults)]
+
+pub struct MyStruct;
+
+impl MyStruct {
+ /// docs for PrivateConst
+ const PrivateConst: i8 = -123;
+ /// docs for PublicConst
+ pub const PublicConst: u8 = 123;
+ /// docs for private_method
+ fn private_method() {}
+ /// docs for public_method
+ pub fn public_method() {}
+}
+
+pub trait MyTrait {
+ /// docs for ConstNoDefault
+ const ConstNoDefault: i16;
+ /// docs for ConstWithDefault
+ const ConstWithDefault: u16 = 12345;
+ /// docs for TypeNoDefault
+ type TypeNoDefault;
+ /// docs for TypeWithDefault
+ type TypeWithDefault = u32;
+ /// docs for method_no_default
+ fn method_no_default();
+ /// docs for method_with_default
+ fn method_with_default() {}
+}
+
+impl MyTrait for MyStruct {
+ /// dox for ConstNoDefault
+ const ConstNoDefault: i16 = -12345;
+ /// dox for TypeNoDefault
+ type TypeNoDefault = i32;
+ /// dox for method_no_default
+ fn method_no_default() {}
+}
diff --git a/tests/rustdoc/inline_cross/auxiliary/assoc_item_trait_bounds.rs b/tests/rustdoc/inline_cross/auxiliary/assoc_item_trait_bounds.rs
new file mode 100644
index 000000000..6644c8e41
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/assoc_item_trait_bounds.rs
@@ -0,0 +1,46 @@
+pub trait Main {
+ type Item;
+
+ type Out0: Support<Item = ()>;
+ type Out1: Support<Item = Self::Item>;
+ type Out2<T>: Support<Item = T>;
+ type Out3: Support<Produce<()> = bool>;
+ type Out4<T>: Support<Produce<T> = T>;
+ type Out5: Support<Output<'static> = &'static ()>;
+ type Out6: for<'a> Support<Output<'a> = &'a ()>;
+ type Out7: Support<Item = String, Produce<i32> = u32> + Unrelated;
+ type Out8: Unrelated + Protocol<i16, Q1 = u128, Q0 = ()>;
+ type Out9: FnMut(i32) -> bool + Clone;
+ type Out10<'q>: Support<Output<'q> = ()>;
+ type Out11: for<'r, 's> Helper<A<'s> = &'s (), B<'r> = ()>;
+ type Out12: for<'w> Helper<B<'w> = std::borrow::Cow<'w, str>, A<'w> = bool>;
+ type Out13: for<'fst, 'snd> Aid<'snd, Result<'fst> = &'fst mut str>;
+ type Out14<P: Copy + Eq, Q: ?Sized>;
+
+ fn make<F>(_: F, _: impl FnMut(&str) -> bool)
+ where
+ F: FnOnce(u32) -> String,
+ Self::Out2<()>: Protocol<u8, Q0 = Self::Item, Q1 = ()>;
+}
+
+pub trait Support {
+ type Item;
+ type Output<'a>;
+ type Produce<T>;
+}
+
+pub trait Protocol<K> {
+ type Q0;
+ type Q1;
+}
+
+pub trait Unrelated {}
+
+pub trait Helper {
+ type A<'q>;
+ type B<'q>;
+}
+
+pub trait Aid<'src> {
+ type Result<'inter: 'src>;
+}
diff --git a/tests/rustdoc/inline_cross/auxiliary/cross-glob.rs b/tests/rustdoc/inline_cross/auxiliary/cross-glob.rs
new file mode 100644
index 000000000..48672590a
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/cross-glob.rs
@@ -0,0 +1,7 @@
+#![crate_name = "inner"]
+
+pub struct SomeStruct;
+
+pub fn some_fn() {}
+
+pub enum Shadowed {}
diff --git a/tests/rustdoc/inline_cross/auxiliary/default-trait-method.rs b/tests/rustdoc/inline_cross/auxiliary/default-trait-method.rs
new file mode 100644
index 000000000..ce60bbfb4
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/default-trait-method.rs
@@ -0,0 +1,16 @@
+#![feature(specialization)]
+
+#![crate_name = "foo"]
+
+pub trait Item {
+ fn foo();
+ fn bar();
+ fn baz() {}
+}
+
+pub struct Foo;
+
+impl Item for Foo {
+ default fn foo() {}
+ fn bar() {}
+}
diff --git a/tests/rustdoc/inline_cross/auxiliary/dyn_trait.rs b/tests/rustdoc/inline_cross/auxiliary/dyn_trait.rs
new file mode 100644
index 000000000..9ac2e3d96
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/dyn_trait.rs
@@ -0,0 +1,17 @@
+pub type Ty0 = dyn for<'any> FnOnce(&'any str) -> bool;
+
+pub type Ty1<'obj> = dyn std::fmt::Display + 'obj;
+
+pub type Ty2 = dyn for<'a, 'r> Container<'r, Item<'a, 'static> = ()>;
+
+pub type Ty3<'s> = &'s dyn ToString;
+
+pub fn func0(_: &(dyn Fn() + '_)) {}
+
+pub fn func1<'func>(_: &(dyn Fn() + 'func)) {}
+
+pub trait Container<'r> {
+ type Item<'a, 'ctx>;
+}
+
+pub trait Shape<'a> {}
diff --git a/tests/rustdoc/inline_cross/auxiliary/impl-inline-without-trait.rs b/tests/rustdoc/inline_cross/auxiliary/impl-inline-without-trait.rs
new file mode 100644
index 000000000..401a6a44a
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/impl-inline-without-trait.rs
@@ -0,0 +1,8 @@
+pub trait MyTrait {
+ /// docs for my_trait_method
+ fn my_trait_method() {}
+}
+
+pub struct MyStruct;
+
+impl MyTrait for MyStruct {}
diff --git a/tests/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs b/tests/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs
new file mode 100644
index 000000000..19433c968
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs
@@ -0,0 +1,41 @@
+// edition:2018
+
+use std::ops::Deref;
+
+pub fn func<'a>(_x: impl Clone + Into<Vec<u8>> + 'a) {}
+
+pub fn func2<T>(
+ _x: impl Deref<Target = Option<T>> + Iterator<Item = T>,
+ _y: impl Iterator<Item = u8>,
+) {}
+
+pub fn func3(_x: impl Iterator<Item = impl Iterator<Item = u8>> + Clone) {}
+
+pub fn func4<T: Iterator<Item = impl Clone>>(_x: T) {}
+
+pub fn func5(
+ _f: impl for<'any> Fn(&'any str, &'any str) -> bool + for<'r> Other<T<'r> = ()>,
+ _a: impl for<'alpha, 'beta> Auxiliary<'alpha, Item<'beta> = fn(&'beta ())>,
+) {}
+
+pub trait Other {
+ type T<'dependency>;
+}
+
+pub trait Auxiliary<'arena> {
+ type Item<'input>;
+}
+
+pub async fn async_fn() {}
+
+pub struct Foo;
+
+impl Foo {
+ pub fn method<'a>(_x: impl Clone + Into<Vec<u8>> + 'a) {}
+}
+
+pub struct Bar;
+
+impl Bar {
+ pub async fn async_foo(&self) {}
+}
diff --git a/tests/rustdoc/inline_cross/auxiliary/implementors_inline.rs b/tests/rustdoc/inline_cross/auxiliary/implementors_inline.rs
new file mode 100644
index 000000000..b003fb357
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/implementors_inline.rs
@@ -0,0 +1,18 @@
+pub mod my_trait {
+ pub trait MyTrait {
+ fn my_fn(&self) -> Self;
+ }
+}
+
+pub mod prelude {
+ #[doc(inline)]
+ pub use crate::my_trait::MyTrait;
+}
+
+pub struct SomeStruct;
+
+impl my_trait::MyTrait for SomeStruct {
+ fn my_fn(&self) -> SomeStruct {
+ SomeStruct
+ }
+}
diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-24183.rs b/tests/rustdoc/inline_cross/auxiliary/issue-24183.rs
new file mode 100644
index 000000000..e7a13acc6
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/issue-24183.rs
@@ -0,0 +1,14 @@
+#![crate_type = "lib"]
+
+pub trait U/*: ?Sized */ {
+ fn modified(self) -> Self
+ where
+ Self: Sized
+ {
+ self
+ }
+
+ fn touch(&self)/* where Self: ?Sized */{}
+}
+
+pub trait S: Sized {}
diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-33113.rs b/tests/rustdoc/inline_cross/auxiliary/issue-33113.rs
new file mode 100644
index 000000000..4e1f1918e
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/issue-33113.rs
@@ -0,0 +1,7 @@
+#![crate_name="bar"]
+
+pub trait Bar {}
+pub struct Foo;
+
+impl<'a> Bar for &'a char {}
+impl Bar for Foo {}
diff --git a/tests/rustdoc/inline_cross/auxiliary/macro-vis.rs b/tests/rustdoc/inline_cross/auxiliary/macro-vis.rs
new file mode 100644
index 000000000..5615a4fdd
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/macro-vis.rs
@@ -0,0 +1,25 @@
+#![crate_name = "qwop"]
+
+/// (written on a spider's web) Some Macro
+#[macro_export]
+macro_rules! some_macro {
+ () => {
+ println!("this is some macro, for sure");
+ };
+}
+
+/// Some other macro, to fill space.
+#[macro_export]
+macro_rules! other_macro {
+ () => {
+ println!("this is some other macro, whatev");
+ };
+}
+
+/// This macro is so cool, it's Super.
+#[macro_export]
+macro_rules! super_macro {
+ () => {
+ println!("is it a bird? a plane? no, it's Super Macro!");
+ };
+}
diff --git a/tests/rustdoc/inline_cross/auxiliary/macros.rs b/tests/rustdoc/inline_cross/auxiliary/macros.rs
new file mode 100644
index 000000000..651ae2f1a
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/macros.rs
@@ -0,0 +1,10 @@
+#![feature(staged_api)]
+#![stable(feature = "rust1", since = "1.0.0")]
+
+/// docs for my_macro
+#[unstable(feature = "macro_test", issue = "none")]
+#[deprecated(since = "1.2.3", note = "text")]
+#[macro_export]
+macro_rules! my_macro {
+ () => {};
+}
diff --git a/tests/rustdoc/inline_cross/auxiliary/proc_macro.rs b/tests/rustdoc/inline_cross/auxiliary/proc_macro.rs
new file mode 100644
index 000000000..d8e5746f3
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/proc_macro.rs
@@ -0,0 +1,47 @@
+// force-host
+// no-prefer-dynamic
+// compile-flags: --crate-type proc-macro
+
+#![crate_type="proc-macro"]
+#![crate_name="some_macros"]
+
+extern crate proc_macro;
+
+use proc_macro::TokenStream;
+
+macro_rules! make_attr_macro {
+ ($name:ident) => {
+ /// Generated doc comment
+ #[proc_macro_attribute]
+ pub fn $name(args: TokenStream, input: TokenStream) -> TokenStream {
+ panic!()
+ }
+ }
+}
+
+make_attr_macro!(first_attr);
+make_attr_macro!(second_attr);
+
+/// a proc-macro that swallows its input and does nothing.
+#[proc_macro]
+pub fn some_proc_macro(_input: TokenStream) -> TokenStream {
+ TokenStream::new()
+}
+
+/// a proc-macro attribute that passes its item through verbatim.
+#[proc_macro_attribute]
+pub fn some_proc_attr(_attr: TokenStream, item: TokenStream) -> TokenStream {
+ item
+}
+
+/// a derive attribute that adds nothing to its input.
+#[proc_macro_derive(SomeDerive)]
+pub fn some_derive(_item: TokenStream) -> TokenStream {
+ TokenStream::new()
+}
+
+/// Doc comment from the original crate
+#[proc_macro]
+pub fn reexported_macro(_input: TokenStream) -> TokenStream {
+ TokenStream::new()
+}
diff --git a/tests/rustdoc/inline_cross/auxiliary/renamed-via-module.rs b/tests/rustdoc/inline_cross/auxiliary/renamed-via-module.rs
new file mode 100644
index 000000000..2e5290782
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/renamed-via-module.rs
@@ -0,0 +1,9 @@
+#![crate_name = "foo"]
+
+pub mod iter {
+ mod range {
+ pub struct StepBy;
+ }
+ pub use self::range::StepBy as DeprecatedStepBy;
+ pub struct StepBy;
+}
diff --git a/tests/rustdoc/inline_cross/auxiliary/rustdoc-hidden-sig.rs b/tests/rustdoc/inline_cross/auxiliary/rustdoc-hidden-sig.rs
new file mode 100644
index 000000000..6357b76df
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/rustdoc-hidden-sig.rs
@@ -0,0 +1,12 @@
+pub struct Bar;
+
+impl Bar {
+ pub fn bar(_: u8) -> hidden::Hidden {
+ hidden::Hidden
+ }
+}
+
+#[doc(hidden)]
+pub mod hidden {
+ pub struct Hidden;
+}
diff --git a/tests/rustdoc/inline_cross/auxiliary/rustdoc-hidden.rs b/tests/rustdoc/inline_cross/auxiliary/rustdoc-hidden.rs
new file mode 100644
index 000000000..0c75b3127
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/rustdoc-hidden.rs
@@ -0,0 +1,4 @@
+#[doc(hidden)]
+pub struct Foo;
+
+pub struct Bar;
diff --git a/tests/rustdoc/inline_cross/auxiliary/rustdoc-nonreachable-impls.rs b/tests/rustdoc/inline_cross/auxiliary/rustdoc-nonreachable-impls.rs
new file mode 100644
index 000000000..4e461d3bc
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/rustdoc-nonreachable-impls.rs
@@ -0,0 +1,34 @@
+pub struct Foo;
+
+pub trait Woof {}
+pub trait Bark {}
+
+mod private {
+ // should be shown
+ impl ::Woof for ::Foo {}
+
+ pub trait Bar {}
+ pub struct Wibble;
+
+ // these should not be shown
+ impl Bar for ::Foo {}
+ impl Bar for Wibble {}
+ impl ::Bark for Wibble {}
+ impl ::Woof for Wibble {}
+}
+
+#[doc(hidden)]
+pub mod hidden {
+ // should be shown
+ impl ::Bark for ::Foo {}
+
+ pub trait Qux {}
+ pub struct Wobble;
+
+
+ // these should only be shown if they're re-exported correctly
+ impl Qux for ::Foo {}
+ impl Qux for Wobble {}
+ impl ::Bark for Wobble {}
+ impl ::Woof for Wobble {}
+}
diff --git a/tests/rustdoc/inline_cross/auxiliary/rustdoc-trait-object-impl.rs b/tests/rustdoc/inline_cross/auxiliary/rustdoc-trait-object-impl.rs
new file mode 100644
index 000000000..11d8733c4
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/rustdoc-trait-object-impl.rs
@@ -0,0 +1,13 @@
+use std::fmt;
+
+pub trait Bar {}
+
+impl<'a> Bar + 'a {
+ pub fn bar(&self) -> usize { 42 }
+}
+
+impl<'a> fmt::Debug for Bar + 'a {
+ fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
+ Ok(())
+ }
+}
diff --git a/tests/rustdoc/inline_cross/auxiliary/trait-vis.rs b/tests/rustdoc/inline_cross/auxiliary/trait-vis.rs
new file mode 100644
index 000000000..e5bc7969b
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/trait-vis.rs
@@ -0,0 +1,13 @@
+#![crate_name = "inner"]
+
+pub struct SomeStruct;
+
+fn asdf() {
+ const _FOO: () = {
+ impl Clone for SomeStruct {
+ fn clone(&self) -> Self {
+ SomeStruct
+ }
+ }
+ };
+}
diff --git a/tests/rustdoc/inline_cross/auxiliary/use_crate.rs b/tests/rustdoc/inline_cross/auxiliary/use_crate.rs
new file mode 100644
index 000000000..75efbe0db
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/use_crate.rs
@@ -0,0 +1,5 @@
+pub mod asdf {
+ pub struct SomeStruct;
+}
+
+pub trait SomeTrait {}
diff --git a/tests/rustdoc/inline_cross/auxiliary/use_crate_2.rs b/tests/rustdoc/inline_cross/auxiliary/use_crate_2.rs
new file mode 100644
index 000000000..25b4c202e
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/use_crate_2.rs
@@ -0,0 +1 @@
+pub struct SomethingElse;
diff --git a/tests/rustdoc/inline_cross/cross-glob.rs b/tests/rustdoc/inline_cross/cross-glob.rs
new file mode 100644
index 000000000..7a519d2d2
--- /dev/null
+++ b/tests/rustdoc/inline_cross/cross-glob.rs
@@ -0,0 +1,16 @@
+// aux-build:cross-glob.rs
+// build-aux-docs
+// ignore-cross-compile
+
+extern crate inner;
+
+// @has cross_glob/struct.SomeStruct.html
+// @has cross_glob/fn.some_fn.html
+// @!has cross_glob/enum.Shadowed.html
+// @!has cross_glob/index.html '//code' 'pub use inner::*;'
+#[doc(inline)]
+pub use inner::*;
+
+// This type shadows the glob-imported enum `Shadowed`.
+// @has cross_glob/type.Shadowed.html
+pub type Shadowed = u8;
diff --git a/tests/rustdoc/inline_cross/default-trait-method.rs b/tests/rustdoc/inline_cross/default-trait-method.rs
new file mode 100644
index 000000000..a4ec73a12
--- /dev/null
+++ b/tests/rustdoc/inline_cross/default-trait-method.rs
@@ -0,0 +1,20 @@
+// aux-build:default-trait-method.rs
+
+extern crate foo;
+
+// @has default_trait_method/trait.Item.html
+// @has - '//*[@id="tymethod.foo"]' 'fn foo()'
+// @!has - '//*[@id="tymethod.foo"]' 'default fn foo()'
+// @has - '//*[@id="tymethod.bar"]' 'fn bar()'
+// @!has - '//*[@id="tymethod.bar"]' 'default fn bar()'
+// @has - '//*[@id="method.baz"]' 'fn baz()'
+// @!has - '//*[@id="method.baz"]' 'default fn baz()'
+pub use foo::Item;
+
+// @has default_trait_method/struct.Foo.html
+// @has - '//*[@id="method.foo"]' 'default fn foo()'
+// @has - '//*[@id="method.bar"]' 'fn bar()'
+// @!has - '//*[@id="method.bar"]' 'default fn bar()'
+// @has - '//*[@id="method.baz"]' 'fn baz()'
+// @!has - '//*[@id="method.baz"]' 'default fn baz()'
+pub use foo::Foo;
diff --git a/tests/rustdoc/inline_cross/dyn_trait.rs b/tests/rustdoc/inline_cross/dyn_trait.rs
new file mode 100644
index 000000000..0da8bfc3a
--- /dev/null
+++ b/tests/rustdoc/inline_cross/dyn_trait.rs
@@ -0,0 +1,31 @@
+#![crate_name = "user"]
+
+// aux-crate:dyn_trait=dyn_trait.rs
+// edition:2021
+
+// @has user/type.Ty0.html
+// @has - '//*[@class="item-decl"]//code' "dyn for<'any> FnOnce(&'any str) -> bool + 'static"
+// FIXME(fmease): Hide default lifetime bound `'static`
+pub use dyn_trait::Ty0;
+
+// @has user/type.Ty1.html
+// @has - '//*[@class="item-decl"]//code' "dyn Display + 'obj"
+pub use dyn_trait::Ty1;
+
+// @has user/type.Ty2.html
+// @has - '//*[@class="item-decl"]//code' "dyn for<'a, 'r> Container<'r, Item<'a, 'static> = ()>"
+pub use dyn_trait::Ty2;
+
+// @has user/type.Ty3.html
+// @has - '//*[@class="item-decl"]//code' "&'s (dyn ToString + 's)"
+// FIXME(fmease): Hide default lifetime bound, render "&'s dyn ToString"
+pub use dyn_trait::Ty3;
+
+// @has user/fn.func0.html
+// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "func0(_: &dyn Fn())"
+// FIXME(fmease): Show placeholder-lifetime bound, render "func0(_: &(dyn Fn() + '_))"
+pub use dyn_trait::func0;
+
+// @has user/fn.func1.html
+// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "func1<'func>(_: &(dyn Fn() + 'func))"
+pub use dyn_trait::func1;
diff --git a/tests/rustdoc/inline_cross/hidden-use.rs b/tests/rustdoc/inline_cross/hidden-use.rs
new file mode 100644
index 000000000..28a4f4bac
--- /dev/null
+++ b/tests/rustdoc/inline_cross/hidden-use.rs
@@ -0,0 +1,12 @@
+// aux-build:rustdoc-hidden.rs
+// build-aux-docs
+// ignore-cross-compile
+
+extern crate rustdoc_hidden;
+
+// @has hidden_use/index.html
+// @!hasraw - 'rustdoc_hidden'
+// @!hasraw - 'Bar'
+// @!has hidden_use/struct.Bar.html
+#[doc(hidden)]
+pub use rustdoc_hidden::Bar;
diff --git a/tests/rustdoc/inline_cross/impl-inline-without-trait.rs b/tests/rustdoc/inline_cross/impl-inline-without-trait.rs
new file mode 100644
index 000000000..9b67022fd
--- /dev/null
+++ b/tests/rustdoc/inline_cross/impl-inline-without-trait.rs
@@ -0,0 +1,12 @@
+// aux-build:impl-inline-without-trait.rs
+// build-aux-docs
+// ignore-cross-compile
+
+#![crate_name = "foo"]
+
+extern crate impl_inline_without_trait;
+
+// @has 'foo/struct.MyStruct.html'
+// @has - '//*[@id="method.my_trait_method"]' 'fn my_trait_method()'
+// @has - '//div[@class="docblock"]' 'docs for my_trait_method'
+pub use impl_inline_without_trait::MyStruct;
diff --git a/tests/rustdoc/inline_cross/impl_trait.rs b/tests/rustdoc/inline_cross/impl_trait.rs
new file mode 100644
index 000000000..e8587209b
--- /dev/null
+++ b/tests/rustdoc/inline_cross/impl_trait.rs
@@ -0,0 +1,47 @@
+// aux-build:impl_trait_aux.rs
+// edition:2018
+
+extern crate impl_trait_aux;
+
+// @has impl_trait/fn.func.html
+// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "pub fn func<'a>(_x: impl Clone + Into<Vec<u8, Global>> + 'a)"
+// @!has - '//div[@class="item-decl"]/pre[@class="rust"]' 'where'
+pub use impl_trait_aux::func;
+
+// @has impl_trait/fn.func2.html
+// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "func2<T>("
+// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "_x: impl Deref<Target = Option<T>> + Iterator<Item = T>,"
+// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "_y: impl Iterator<Item = u8>)"
+// @!has - '//div[@class="item-decl"]/pre[@class="rust"]' 'where'
+pub use impl_trait_aux::func2;
+
+// @has impl_trait/fn.func3.html
+// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "func3("
+// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "_x: impl Iterator<Item = impl Iterator<Item = u8>> + Clone)"
+// @!has - '//div[@class="item-decl"]/pre[@class="rust"]' 'where'
+pub use impl_trait_aux::func3;
+
+// @has impl_trait/fn.func4.html
+// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "func4<T>("
+// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "T: Iterator<Item = impl Clone>,"
+pub use impl_trait_aux::func4;
+
+// @has impl_trait/fn.func5.html
+// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "func5("
+// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "_f: impl for<'any> Fn(&'any str, &'any str) -> bool + for<'r> Other<T<'r> = ()>,"
+// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "_a: impl for<'alpha, 'beta> Auxiliary<'alpha, Item<'beta> = fn(_: &'beta ())>"
+// @!has - '//div[@class="item-decl"]/pre[@class="rust"]' 'where'
+pub use impl_trait_aux::func5;
+
+// @has impl_trait/fn.async_fn.html
+// @has - '//div[@class="item-decl"]/pre[@class="rust"]' "pub async fn async_fn()"
+pub use impl_trait_aux::async_fn;
+
+// @has impl_trait/struct.Foo.html
+// @has - '//*[@id="method.method"]//h4[@class="code-header"]' "pub fn method<'a>(_x: impl Clone + Into<Vec<u8, Global>> + 'a)"
+// @!has - '//*[@id="method.method"]//h4[@class="code-header"]' 'where'
+pub use impl_trait_aux::Foo;
+
+// @has impl_trait/struct.Bar.html
+// @has - '//*[@id="method.async_foo"]' "pub async fn async_foo("
+pub use impl_trait_aux::Bar;
diff --git a/tests/rustdoc/inline_cross/implementors-js.rs b/tests/rustdoc/inline_cross/implementors-js.rs
new file mode 100644
index 000000000..c79f05d8d
--- /dev/null
+++ b/tests/rustdoc/inline_cross/implementors-js.rs
@@ -0,0 +1,25 @@
+// aux-build:implementors_inline.rs
+// build-aux-docs
+// ignore-cross-compile
+
+extern crate implementors_inline;
+
+// @!has implementors/implementors_js/trait.MyTrait.js
+// @has implementors/implementors_inline/my_trait/trait.MyTrait.js
+// @!has implementors/implementors_inline/prelude/trait.MyTrait.js
+// @has implementors_inline/my_trait/trait.MyTrait.html
+// @has - '//script/@src' '../../implementors/implementors_inline/my_trait/trait.MyTrait.js'
+// @has implementors_js/trait.MyTrait.html
+// @has - '//script/@src' '../implementors/implementors_inline/my_trait/trait.MyTrait.js'
+/// When re-exporting this trait, the HTML will be inlined,
+/// but, vitally, the JavaScript will be located only at the
+/// one canonical path.
+pub use implementors_inline::prelude::MyTrait;
+
+pub struct OtherStruct;
+
+impl MyTrait for OtherStruct {
+ fn my_fn(&self) -> OtherStruct {
+ OtherStruct
+ }
+}
diff --git a/tests/rustdoc/inline_cross/inline_hidden.rs b/tests/rustdoc/inline_cross/inline_hidden.rs
new file mode 100644
index 000000000..dcceaadb9
--- /dev/null
+++ b/tests/rustdoc/inline_cross/inline_hidden.rs
@@ -0,0 +1,12 @@
+// aux-build:rustdoc-hidden.rs
+// build-aux-docs
+// ignore-cross-compile
+
+extern crate rustdoc_hidden;
+
+#[doc(no_inline)]
+pub use rustdoc_hidden::Foo;
+
+// @has inline_hidden/fn.foo.html
+// @!has - '//a/@title' 'Foo'
+pub fn foo(_: Foo) {}
diff --git a/tests/rustdoc/inline_cross/issue-24183.method_no_where_self_sized.html b/tests/rustdoc/inline_cross/issue-24183.method_no_where_self_sized.html
new file mode 100644
index 000000000..f3c1c0452
--- /dev/null
+++ b/tests/rustdoc/inline_cross/issue-24183.method_no_where_self_sized.html
@@ -0,0 +1 @@
+<h4 class="code-header">fn <a href="#method.touch" class="fn">touch</a>(&amp;self)</h4> \ No newline at end of file
diff --git a/tests/rustdoc/inline_cross/issue-24183.rs b/tests/rustdoc/inline_cross/issue-24183.rs
new file mode 100644
index 000000000..d11b6955f
--- /dev/null
+++ b/tests/rustdoc/inline_cross/issue-24183.rs
@@ -0,0 +1,18 @@
+#![crate_type = "lib"]
+#![crate_name = "usr"]
+
+// aux-crate:issue_24183=issue-24183.rs
+// edition: 2021
+
+// @has usr/trait.U.html
+// @has - '//*[@class="item-decl"]' "pub trait U {"
+// @has - '//*[@id="method.modified"]' \
+// "fn modified(self) -> Self\
+// where \
+// Self: Sized"
+// @snapshot method_no_where_self_sized - '//*[@id="method.touch"]/*[@class="code-header"]'
+pub use issue_24183::U;
+
+// @has usr/trait.S.html
+// @has - '//*[@class="item-decl"]' 'pub trait S: Sized {'
+pub use issue_24183::S;
diff --git a/tests/rustdoc/inline_cross/issue-28480.rs b/tests/rustdoc/inline_cross/issue-28480.rs
new file mode 100644
index 000000000..99f5b9007
--- /dev/null
+++ b/tests/rustdoc/inline_cross/issue-28480.rs
@@ -0,0 +1,13 @@
+// aux-build:rustdoc-hidden-sig.rs
+// build-aux-docs
+// ignore-cross-compile
+
+// @has rustdoc_hidden_sig/struct.Bar.html
+// @!has - '//a/@title' 'Hidden'
+// @has - '//a' 'u8'
+extern crate rustdoc_hidden_sig;
+
+// @has issue_28480/struct.Bar.html
+// @!has - '//a/@title' 'Hidden'
+// @has - '//a' 'u8'
+pub use rustdoc_hidden_sig::Bar;
diff --git a/tests/rustdoc/inline_cross/issue-31948-1.rs b/tests/rustdoc/inline_cross/issue-31948-1.rs
new file mode 100644
index 000000000..6e89167b3
--- /dev/null
+++ b/tests/rustdoc/inline_cross/issue-31948-1.rs
@@ -0,0 +1,27 @@
+// aux-build:rustdoc-nonreachable-impls.rs
+// build-aux-docs
+// ignore-cross-compile
+
+extern crate rustdoc_nonreachable_impls;
+
+// @has issue_31948_1/struct.Wobble.html
+// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Bark for'
+// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Woof for'
+// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bar for'
+// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'Qux for'
+pub use rustdoc_nonreachable_impls::hidden::Wobble;
+
+// @has issue_31948_1/trait.Bark.html
+// @has - '//h3[@class="code-header"]' 'for Foo'
+// @has - '//h3[@class="code-header"]' 'for Wobble'
+// @!has - '//h3[@class="code-header"]' 'for Wibble'
+pub use rustdoc_nonreachable_impls::Bark;
+
+// @has issue_31948_1/trait.Woof.html
+// @has - '//h3[@class="code-header"]' 'for Foo'
+// @has - '//h3[@class="code-header"]' 'for Wobble'
+// @!has - '//h3[@class="code-header"]' 'for Wibble'
+pub use rustdoc_nonreachable_impls::Woof;
+
+// @!has issue_31948_1/trait.Bar.html
+// @!has issue_31948_1/trait.Qux.html
diff --git a/tests/rustdoc/inline_cross/issue-31948-2.rs b/tests/rustdoc/inline_cross/issue-31948-2.rs
new file mode 100644
index 000000000..141e07656
--- /dev/null
+++ b/tests/rustdoc/inline_cross/issue-31948-2.rs
@@ -0,0 +1,21 @@
+// aux-build:rustdoc-nonreachable-impls.rs
+// build-aux-docs
+// ignore-cross-compile
+
+extern crate rustdoc_nonreachable_impls;
+
+// @has issue_31948_2/struct.Wobble.html
+// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Qux for'
+// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Bark for'
+// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Woof for'
+// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bar for'
+pub use rustdoc_nonreachable_impls::hidden::Wobble;
+
+// @has issue_31948_2/trait.Qux.html
+// @has - '//h3[@class="code-header"]' 'for Foo'
+// @has - '//h3[@class="code-header"]' 'for Wobble'
+pub use rustdoc_nonreachable_impls::hidden::Qux;
+
+// @!has issue_31948_2/trait.Bar.html
+// @!has issue_31948_2/trait.Woof.html
+// @!has issue_31948_2/trait.Bark.html
diff --git a/tests/rustdoc/inline_cross/issue-31948.rs b/tests/rustdoc/inline_cross/issue-31948.rs
new file mode 100644
index 000000000..96fc6ca47
--- /dev/null
+++ b/tests/rustdoc/inline_cross/issue-31948.rs
@@ -0,0 +1,29 @@
+// aux-build:rustdoc-nonreachable-impls.rs
+// build-aux-docs
+// ignore-cross-compile
+
+extern crate rustdoc_nonreachable_impls;
+
+// @has issue_31948/struct.Foo.html
+// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Bark for'
+// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Woof for'
+// @!has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Bar for'
+// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'Qux for'
+pub use rustdoc_nonreachable_impls::Foo;
+
+// @has issue_31948/trait.Bark.html
+// @has - '//h3[@class="code-header"]' 'for Foo'
+// @!has - '//h3[@class="code-header"]' 'for Wibble'
+// @!has - '//h3[@class="code-header"]' 'for Wobble'
+pub use rustdoc_nonreachable_impls::Bark;
+
+// @has issue_31948/trait.Woof.html
+// @has - '//h3[@class="code-header"]' 'for Foo'
+// @!has - '//h3[@class="code-header"]' 'for Wibble'
+// @!has - '//h3[@class="code-header"]' 'for Wobble'
+pub use rustdoc_nonreachable_impls::Woof;
+
+// @!has issue_31948/trait.Bar.html
+// @!has issue_31948/trait.Qux.html
+// @!has issue_31948/struct.Wibble.html
+// @!has issue_31948/struct.Wobble.html
diff --git a/tests/rustdoc/inline_cross/issue-32881.rs b/tests/rustdoc/inline_cross/issue-32881.rs
new file mode 100644
index 000000000..183fd15ab
--- /dev/null
+++ b/tests/rustdoc/inline_cross/issue-32881.rs
@@ -0,0 +1,11 @@
+// aux-build:rustdoc-trait-object-impl.rs
+// build-aux-docs
+// ignore-cross-compile
+
+extern crate rustdoc_trait_object_impl;
+
+// @has issue_32881/trait.Bar.html
+// @has - '//h3[@class="code-header"]' "impl<'a> dyn Bar"
+// @has - '//h3[@class="code-header"]' "impl<'a> Debug for dyn Bar"
+
+pub use rustdoc_trait_object_impl::Bar;
diff --git a/tests/rustdoc/inline_cross/issue-33113.rs b/tests/rustdoc/inline_cross/issue-33113.rs
new file mode 100644
index 000000000..d954707fa
--- /dev/null
+++ b/tests/rustdoc/inline_cross/issue-33113.rs
@@ -0,0 +1,10 @@
+// aux-build:issue-33113.rs
+// build-aux-docs
+// ignore-cross-compile
+
+extern crate bar;
+
+// @has issue_33113/trait.Bar.html
+// @has - '//h3[@class="code-header"]' "for &'a char"
+// @has - '//h3[@class="code-header"]' "for Foo"
+pub use bar::Bar;
diff --git a/tests/rustdoc/inline_cross/macro-vis.rs b/tests/rustdoc/inline_cross/macro-vis.rs
new file mode 100644
index 000000000..9fefd38ad
--- /dev/null
+++ b/tests/rustdoc/inline_cross/macro-vis.rs
@@ -0,0 +1,36 @@
+// aux-build:macro-vis.rs
+// build-aux-docs
+// ignore-cross-compile
+
+#[macro_use] extern crate qwop;
+
+// @has macro_vis/macro.some_macro.html
+// @has macro_vis/index.html '//a/@href' 'macro.some_macro.html'
+pub use qwop::some_macro;
+
+// @has macro_vis/macro.renamed_macro.html
+// @!has - '//pre' 'some_macro'
+// @has macro_vis/index.html '//a/@href' 'macro.renamed_macro.html'
+#[doc(inline)]
+pub use qwop::some_macro as renamed_macro;
+
+// @!has macro_vis/macro.other_macro.html
+// @!has macro_vis/index.html '//a/@href' 'macro.other_macro.html'
+// @!has - '//code' 'pub use qwop::other_macro;'
+#[doc(hidden)]
+pub use qwop::other_macro;
+
+// @has macro_vis/index.html '//code' 'pub use qwop::super_macro;'
+// @!has macro_vis/macro.super_macro.html
+#[doc(no_inline)]
+pub use qwop::super_macro;
+
+// @has macro_vis/macro.this_is_dope.html
+// @has macro_vis/index.html '//a/@href' 'macro.this_is_dope.html'
+/// What it says on the tin.
+#[macro_export]
+macro_rules! this_is_dope {
+ () => {
+ println!("yo check this out");
+ };
+}
diff --git a/tests/rustdoc/inline_cross/macros.rs b/tests/rustdoc/inline_cross/macros.rs
new file mode 100644
index 000000000..5daa0d4ba
--- /dev/null
+++ b/tests/rustdoc/inline_cross/macros.rs
@@ -0,0 +1,19 @@
+// aux-build:macros.rs
+// build-aux-docs
+
+#![feature(macro_test)]
+#![crate_name = "foo"]
+
+extern crate macros;
+
+// @has foo/index.html '//*[@class="item-left unstable deprecated module-item"]/span[@class="stab deprecated"]' \
+// Deprecated
+// @has - '//*[@class="item-left unstable deprecated module-item"]/span[@class="stab unstable"]' \
+// Experimental
+
+// @has foo/macro.my_macro.html
+// @has - '//*[@class="docblock"]' 'docs for my_macro'
+// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.2.3: text'
+// @has - '//*[@class="stab unstable"]' 'macro_test'
+// @has - '//a/@href' '../src/macros/macros.rs.html#8'
+pub use macros::my_macro;
diff --git a/tests/rustdoc/inline_cross/proc_macro.rs b/tests/rustdoc/inline_cross/proc_macro.rs
new file mode 100644
index 000000000..a46550865
--- /dev/null
+++ b/tests/rustdoc/inline_cross/proc_macro.rs
@@ -0,0 +1,36 @@
+// aux-build:proc_macro.rs
+// build-aux-docs
+
+extern crate some_macros;
+
+// @has proc_macro/index.html
+// @has - '//a/@href' 'macro.some_proc_macro.html'
+// @has - '//a/@href' 'attr.some_proc_attr.html'
+// @has - '//a/@href' 'derive.SomeDerive.html'
+// @has proc_macro/macro.some_proc_macro.html
+// @has proc_macro/attr.some_proc_attr.html
+// @has proc_macro/derive.SomeDerive.html
+
+// @has proc_macro/macro.some_proc_macro.html
+// @hasraw - 'a proc-macro that swallows its input and does nothing.'
+pub use some_macros::some_proc_macro;
+
+// @has proc_macro/macro.reexported_macro.html
+// @hasraw - 'Doc comment from the original crate'
+pub use some_macros::reexported_macro;
+
+// @has proc_macro/attr.some_proc_attr.html
+// @hasraw - 'a proc-macro attribute that passes its item through verbatim.'
+pub use some_macros::some_proc_attr;
+
+// @has proc_macro/derive.SomeDerive.html
+// @hasraw - 'a derive attribute that adds nothing to its input.'
+pub use some_macros::SomeDerive;
+
+// @has proc_macro/attr.first_attr.html
+// @hasraw - 'Generated doc comment'
+pub use some_macros::first_attr;
+
+// @has proc_macro/attr.second_attr.html
+// @hasraw - 'Generated doc comment'
+pub use some_macros::second_attr;
diff --git a/tests/rustdoc/inline_cross/renamed-via-module.rs b/tests/rustdoc/inline_cross/renamed-via-module.rs
new file mode 100644
index 000000000..cdedbf070
--- /dev/null
+++ b/tests/rustdoc/inline_cross/renamed-via-module.rs
@@ -0,0 +1,24 @@
+// aux-build:renamed-via-module.rs
+// build-aux-docs
+// ignore-cross-compile
+
+#![crate_name = "bar"]
+
+extern crate foo;
+
+// @has foo/iter/index.html
+// @has - '//a/[@href="struct.DeprecatedStepBy.html"]' "DeprecatedStepBy"
+// @has - '//a/[@href="struct.StepBy.html"]' "StepBy"
+// @has foo/iter/struct.DeprecatedStepBy.html
+// @has - '//h1' "Struct foo::iter::DeprecatedStepBy"
+// @has foo/iter/struct.StepBy.html
+// @has - '//h1' "Struct foo::iter::StepBy"
+
+// @has bar/iter/index.html
+// @has - '//a/[@href="struct.DeprecatedStepBy.html"]' "DeprecatedStepBy"
+// @has - '//a/[@href="struct.StepBy.html"]' "StepBy"
+// @has bar/iter/struct.DeprecatedStepBy.html
+// @has - '//h1' "Struct bar::iter::DeprecatedStepBy"
+// @has bar/iter/struct.StepBy.html
+// @has - '//h1' "Struct bar::iter::StepBy"
+pub use foo::iter;
diff --git a/tests/rustdoc/inline_cross/trait-vis.rs b/tests/rustdoc/inline_cross/trait-vis.rs
new file mode 100644
index 000000000..b646babac
--- /dev/null
+++ b/tests/rustdoc/inline_cross/trait-vis.rs
@@ -0,0 +1,7 @@
+// aux-build:trait-vis.rs
+
+extern crate inner;
+
+// @has trait_vis/struct.SomeStruct.html
+// @has - '//h3[@class="code-header"]' 'impl Clone for SomeStruct'
+pub use inner::SomeStruct;
diff --git a/tests/rustdoc/inline_cross/use_crate.rs b/tests/rustdoc/inline_cross/use_crate.rs
new file mode 100644
index 000000000..00e0f041c
--- /dev/null
+++ b/tests/rustdoc/inline_cross/use_crate.rs
@@ -0,0 +1,27 @@
+// aux-build:use_crate.rs
+// aux-build:use_crate_2.rs
+// build-aux-docs
+// edition:2018
+// compile-flags:--extern use_crate --extern use_crate_2
+
+// During the buildup to Rust 2018, rustdoc would eagerly inline `pub use some_crate;` as if it
+// were a module, so we changed it to make `pub use`ing crate roots remain as a `pub use` statement
+// in docs... unless you added `#[doc(inline)]`.
+
+#![crate_name = "local"]
+
+// @!has-dir local/use_crate
+// @has local/index.html
+// @has - '//code' 'pub use use_crate'
+pub use use_crate;
+
+// @has-dir local/asdf
+// @has local/asdf/index.html
+// @has local/index.html '//a/@href' 'asdf/index.html'
+pub use use_crate::asdf;
+
+// @has-dir local/use_crate_2
+// @has local/use_crate_2/index.html
+// @has local/index.html '//a/@href' 'use_crate_2/index.html'
+#[doc(inline)]
+pub use use_crate_2;