diff options
| author | Joshua Nelson <jyn514@gmail.com> | 2020-10-11 20:27:17 -0400 |
|---|---|---|
| committer | Joshua Nelson <jyn514@gmail.com> | 2020-10-11 20:27:17 -0400 |
| commit | 1772f2d2dcb404e3240b73c59fb67d144954bc30 (patch) | |
| tree | c44f59edf486326c90206bc6649ab7e58e1051a8 /src/test/rustdoc | |
| parent | c38f001db5e16f1e0db47c5aed80394e9df5430a (diff) | |
| download | rust-1772f2d2dcb404e3240b73c59fb67d144954bc30.tar.gz rust-1772f2d2dcb404e3240b73c59fb67d144954bc30.zip | |
Show summary lines on cross-crate re-exports
This removes the unnecessary `DocFragmentKind::Divider` in favor of just using the logic I actually want in `collapse_docs`.
Diffstat (limited to 'src/test/rustdoc')
4 files changed, 23 insertions, 2 deletions
diff --git a/src/test/rustdoc/auxiliary/intra-link-reexport-additional-docs.rs b/src/test/rustdoc/auxiliary/intra-link-reexport-additional-docs.rs new file mode 100644 index 00000000000..fc51995a94e --- /dev/null +++ b/src/test/rustdoc/auxiliary/intra-link-reexport-additional-docs.rs @@ -0,0 +1,6 @@ +#![crate_name = "inner"] + +/// Links to [f()] +pub struct Inner; + +pub fn f() {} diff --git a/src/test/rustdoc/auxiliary/reexport-check.rs b/src/test/rustdoc/auxiliary/reexport-check.rs new file mode 100644 index 00000000000..672ccb1cf0e --- /dev/null +++ b/src/test/rustdoc/auxiliary/reexport-check.rs @@ -0,0 +1,2 @@ +/// Docs in original +pub struct S; diff --git a/src/test/rustdoc/intra-link-reexport-additional-docs.rs b/src/test/rustdoc/intra-link-reexport-additional-docs.rs index adb072a7ed5..96f3580f305 100644 --- a/src/test/rustdoc/intra-link-reexport-additional-docs.rs +++ b/src/test/rustdoc/intra-link-reexport-additional-docs.rs @@ -1,6 +1,9 @@ +// aux-build:intra-link-reexport-additional-docs.rs +// build-aux-docs #![crate_name = "foo"] +extern crate inner; -// @has foo/struct.JoinPathsError.html '//a[@href="../foo/fn.with_code.html"]' 'crate::with_code' +// @has foo/struct.Inner.html '//a[@href="../foo/fn.with_code.html"]' 'crate::with_code' /// [crate::with_code] // @has - '//a[@href="../foo/fn.with_code.html"]' 'different text' /// [different text][with_code] @@ -11,7 +14,9 @@ #[doc = "has an attr in the way"] /// /// [reference link]: me_three -pub use std::env::JoinPathsError; +// Should still resolve links from the original module in that scope +// @has - '//a[@href="../inner/fn.f.html"]' 'f()' +pub use inner::Inner; pub fn with_code() {} pub fn me_too() {} diff --git a/src/test/rustdoc/reexport-check.rs b/src/test/rustdoc/reexport-check.rs index dea72b81a57..066b0cfe5e8 100644 --- a/src/test/rustdoc/reexport-check.rs +++ b/src/test/rustdoc/reexport-check.rs @@ -1,5 +1,8 @@ +// aux-build:reexport-check.rs #![crate_name = "foo"] +extern crate reexport_check; + // @!has 'foo/index.html' '//code' 'pub use self::i32;' // @has 'foo/index.html' '//tr[@class="module-item"]' 'i32' // @has 'foo/i32/index.html' @@ -7,3 +10,8 @@ pub use std::i32; // @!has 'foo/index.html' '//code' 'pub use self::string::String;' // @has 'foo/index.html' '//tr[@class="module-item"]' 'String' pub use std::string::String; + +// @has 'foo/index.html' '//td[@class="docblock-short"]' 'Docs in original' +// this is a no-op, but shows what happens if there's an attribute that isn't a doc-comment +#[doc(inline)] +pub use reexport_check::S; |
