Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Particially revert #73771 #76529

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions src/librustdoc/clean/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
12 changes: 12 additions & 0 deletions src/test/rustdoc/auxiliary/all_unstable.rs
Original file line number Diff line number Diff line change
@@ -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 {}
11 changes: 11 additions & 0 deletions src/test/rustdoc/issue-75588.rs
Original file line number Diff line number Diff line change
@@ -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;
10 changes: 10 additions & 0 deletions src/tools/linkchecker/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:/rust-lang/rust/issues/74481
("std/collections/btree_map/struct.BTreeMap.html", &["#insert-and-complex-keys"]),
Expand Down Expand Up @@ -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
}
}
Expand Down