From 1f6a155aa0d392e24b7dc9be093388d318ac2c57 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Wed, 9 Sep 2020 15:44:24 +0000 Subject: [PATCH 1/3] Add test for Implementors of exported traits --- src/test/rustdoc/auxiliary/all_unstable.rs | 12 ++++++++++++ src/test/rustdoc/issue-75588.rs | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/test/rustdoc/auxiliary/all_unstable.rs create mode 100644 src/test/rustdoc/issue-75588.rs diff --git a/src/test/rustdoc/auxiliary/all_unstable.rs b/src/test/rustdoc/auxiliary/all_unstable.rs new file mode 100644 index 0000000000000..b1a64baae800c --- /dev/null +++ b/src/test/rustdoc/auxiliary/all_unstable.rs @@ -0,0 +1,12 @@ +#![crate_name = "unstabled"] +#![feature(staged_api)] +#![unstable(feature = "extremely_unstable", issue = "none")] + +#[unstable(feature = "extremely_unstable_foo", issue = "none")] +pub struct Foo {} + +#[unstable(feature = "extremely_unstable_foo", issue = "none")] +pub trait Join {} + +#[unstable(feature = "extremely_unstable_foo", issue = "none")] +impl Join for Foo {} diff --git a/src/test/rustdoc/issue-75588.rs b/src/test/rustdoc/issue-75588.rs new file mode 100644 index 0000000000000..7c613a079b1ba --- /dev/null +++ b/src/test/rustdoc/issue-75588.rs @@ -0,0 +1,11 @@ +// aux-build:all_unstable.rs + +// Ensure unstably exported traits have their Implementors sections. + +#![crate_name = "foo"] +#![feature(extremely_unstable_foo)] + +extern crate unstabled; + +// @has foo/trait.Join.html '//*[@id="impl-Join-for-Foo"]//code' 'impl Join for Foo' +pub use unstabled::Join; From 29efeb7a65411e2c90693266bafb39c8417f21bb Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Wed, 9 Sep 2020 15:46:33 +0000 Subject: [PATCH 2/3] partially revert #73771 --- src/librustdoc/clean/inline.rs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index 50cb987cf0870..2d8e98413542a 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -341,18 +341,6 @@ pub fn build_impl( return; } } - - // Skip foreign unstable traits from lists of trait implementations and - // such. This helps prevent dependencies of the standard library, for - // example, from getting documented as "traits `u32` implements" which - // isn't really too helpful. - if let Some(trait_did) = associated_trait { - if let Some(stab) = cx.tcx.lookup_stability(trait_did.def_id) { - if stab.level.is_unstable() { - return; - } - } - } } let for_ = if let Some(did) = did.as_local() { From 3a9c5ae8bd80ce7f39aed463d450a0406089a7e4 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Thu, 10 Sep 2020 04:14:57 +0000 Subject: [PATCH 3/3] Add hard-to-fix broken links to linkchecker exception --- src/tools/linkchecker/main.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/tools/linkchecker/main.rs b/src/tools/linkchecker/main.rs index 7ec12116c2ca1..e07404c2aa6a2 100644 --- a/src/tools/linkchecker/main.rs +++ b/src/tools/linkchecker/main.rs @@ -42,6 +42,10 @@ const LINKCHECK_EXCEPTIONS: &[(&str, &[&str])] = &[ "#method.get_unchecked_mut", ], ), + // FIXME(#74672): "Read more" is broken + ("std/primitive.usize.html", &["#tymethod.from_u64"]), + ("std/primitive.u32.html", &["#tymethod.from_u64"]), + ("std/primitive.u64.html", &["#tymethod.from_u64"]), // These try to link to std::collections, but are defined in alloc // https://github.com/rust-lang/rust/issues/74481 ("std/collections/btree_map/struct.BTreeMap.html", &["#insert-and-complex-keys"]), @@ -142,6 +146,12 @@ fn is_exception(file: &Path, link: &str) -> bool { if let Some(entry) = LINKCHECK_EXCEPTIONS.iter().find(|&(f, _)| file.ends_with(f)) { entry.1.contains(&link) } else { + // FIXME(#63351): Concat trait in alloc/slice reexported in primitive page + if file.ends_with("std/primitive.slice.html") { + if link.ends_with("std/primitive.slice.html") { + return true; + } + } false } }