Repository navigation
compiler-docs: Missing trait impls for type #76736
Description
This is a regression from stable to beta, although this issue will be P-low.
The problem is #73771 ignored documenting unstable traits for non-local types,
#76571 fixes some regressions caused by it but the regression
in nightly-rustc / compiler docs still opens.
For example: Compare https://doc.rust-lang.org/nightly/nightly-rustc/rustc_expand/base/struct.ExtCtxt.html#blanket-implementations and https://doc.rust-lang.org/1.46.0/nightly-rustc/rustc_expand/base/struct.ExtCtxt.html#blanket-implementations .
The doc in 1.46.0 has MaybeResult impl, while on nightly it doesn't have.
A way to fix this issue is ignoring this check when the compiling-crates
are being passed -Zforce-unstable-if-unmarked flag or the crate/module has rustc_private feature:
rust/src/librustdoc/clean/inline.rs
Lines 345 to 374 in c743fc4
| if let Some(stab) = tcx.lookup_stability(did) { | |
| if stab.level.is_unstable() && stab.feature == sym::rustc_private { | |
| return; | |
| } | |
| } | |
| } | |
| } | |
| let for_ = if let Some(did) = did.as_local() { | |
| let hir_id = tcx.hir().local_def_id_to_hir_id(did); | |
| match tcx.hir().expect_item(hir_id).kind { | |
| hir::ItemKind::Impl { self_ty, .. } => self_ty.clean(cx), | |
| _ => panic!("did given to build_impl was not an impl"), | |
| } | |
| } else { | |
| tcx.type_of(did).clean(cx) | |
| }; | |
| // Only inline impl if the implementing type is | |
| // reachable in rustdoc generated documentation | |
| if !did.is_local() { | |
| if let Some(did) = for_.def_id() { | |
| if !cx.renderinfo.borrow().access_levels.is_public(did) { | |
| return; | |
| } | |
| if let Some(stab) = tcx.lookup_stability(did) { | |
| if stab.level.is_unstable() && stab.feature == sym::rustc_private { | |
| return; | |
| } |
Meta
rustc --version --verbose: Version 1.48.0-nightly (9b41541 2020-09-14)
Activity
[-]rustdoc(nightly-rustc): Missing trait impls for type[/-][+]compiler-docs: Missing trait impls for type[/+]jakevossen5 commentedon Oct 4, 2020
Hey! I would like to check this out if that is okay
camelid commentedon Oct 4, 2020
Is this actually a regression?
2 remaining items
jakevossen5 commentedon Oct 29, 2020
@jyn514 Thanks! Yes, I am still interested, I have been busy that past few weeks. I will give it a shot this weekend and will reach out if I can't figure it out!
tesuji commentedon Jan 5, 2021
@jakevossen5 Since zulip is lag in my region at night, I post a respond here.
You could use
tcx.sess.opts.debugging_opts.force_unstable_if_unmarkedto check for-Zforce-unstable-if-unmarkedflag passed during compilation.leokhachatorians commentedon Jan 13, 2022
I think I'll hop onto this if that's OK. I've always wanted to contribute :)
jakevossen5 commentedon Jan 13, 2022
Go for it!
Rollup merge of rust-lang#121218 - ShoyuVanilla:fix-issue-76736, r=no…
Unrolled build for rust-lang#121218
ShoyuVanilla commentedon Mar 7, 2024
It doesn't seem to be fixed by #121218 😢 I'll check the cause