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

compiler-docs: Missing trait impls for type #76736

Closed
tesuji opened this issue Sep 15, 2020 · 9 comments · Fixed by #121218
Closed

compiler-docs: Missing trait impls for type #76736

tesuji opened this issue Sep 15, 2020 · 9 comments · Fixed by #121218
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. P-low Low priority T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@tesuji
Copy link
Contributor

tesuji commented Sep 15, 2020

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:

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)

@tesuji tesuji added the C-bug Category: This is a bug. label Sep 15, 2020
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Sep 15, 2020
@apiraino apiraino added the P-low Low priority label Sep 15, 2020
@jonas-schievink jonas-schievink added the regression-from-stable-to-beta Performance or correctness regression from stable to beta. label Sep 15, 2020
@tesuji tesuji changed the title rustdoc(nightly-rustc): Missing trait impls for type compiler-docs: Missing trait impls for type Sep 15, 2020
@jyn514 jyn514 added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Sep 15, 2020
@apiraino apiraino removed the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 16, 2020
@jyn514 jyn514 added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Sep 16, 2020
@jakevossen5
Copy link
Contributor

Hey! I would like to check this out if that is okay

@camelid
Copy link
Member

camelid commented Oct 4, 2020

Is this actually a regression?

@Mark-Simulacrum Mark-Simulacrum removed the regression-from-stable-to-beta Performance or correctness regression from stable to beta. label Oct 4, 2020
@Mark-Simulacrum
Copy link
Member

Dropping regression label. nightly-rustc docs are, well, not really important on non-nightly channels, as they cannot be used by normal consumers.

@jyn514
Copy link
Member

jyn514 commented Oct 29, 2020

@jakevossen5 if you're still interested in working on this we'd love to have the help!
If you have trouble, feel free to ask for help in the rustdoc channel or on Zulip :)

@jakevossen5
Copy link
Contributor

jakevossen5 commented 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
Copy link
Contributor Author

tesuji commented 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_unmarked to check for
-Zforce-unstable-if-unmarked flag passed during compilation.

@leokhachatorians
Copy link

I think I'll hop onto this if that's OK. I've always wanted to contribute :)

@jakevossen5
Copy link
Contributor

Go for it!

@bors bors closed this as completed in 8ba0ad0 Feb 18, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Feb 18, 2024
Rollup merge of rust-lang#121218 - ShoyuVanilla:fix-issue-76736, r=notriddle

Fix missing trait impls for type in rustc docs

Fixes rust-lang#76736
@ShoyuVanilla
Copy link
Member

It doesn't seem to be fixed by #121218 😢 I'll check the cause

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. P-low Low priority T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.