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

Do not render unstable items for rustc doc #74351

Merged
merged 2 commits into from
Jul 17, 2020

Conversation

tesuji
Copy link
Contributor

@tesuji tesuji commented Jul 15, 2020

See the zulip conversation at https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/rustc.20doc.3A.20.22internal.20compiler.20API.22.20warns.20are.20everywhere!/near/203850782

Before:
image
After:
image

Nothing changes in unstable items of std:
Before:
image
After:
image

Closes #54682

@rust-highfive
Copy link
Collaborator

r? @ollie27

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 15, 2020
@tesuji
Copy link
Contributor Author

tesuji commented Jul 15, 2020

r? @Mark-Simulacrum

@tesuji tesuji force-pushed the remove-rustc-internal-compiler-warns branch 5 times, most recently from 78861c7 to e182b74 Compare July 15, 2020 07:52
Copy link
Member

@ollie27 ollie27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR will fix #54682.

The now unused CSS should be removed:

.stab.internal a {
color: #304FFE;
}
and
.stab.internal { background: #FFB9B3; border-color: #B71C1C; }
for every theme.

src/librustdoc/externalfiles.rs Outdated Show resolved Hide resolved
// compile-flags: -Z force-unstable-if-unmarked

// @matches internal/index.html '//*[@class="docblock-short"]/span[@class="stab internal"]' \
// 'Internal'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test should be modified to check that the unstable marker is not added for rustc_private.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@GuillaumeGomez
Copy link
Member

Also: can you remove the changes coming from #74359 please? It makes the changes more noisy than necessary.

As rustc is permanently unstable. So marking every items
with unstable is essential useless.
@tesuji tesuji force-pushed the remove-rustc-internal-compiler-warns branch from e182b74 to 47fea96 Compare July 15, 2020 10:53
@tesuji
Copy link
Contributor Author

tesuji commented Jul 15, 2020

Resolved comment reviews.

// Render unstable items. But don't render "rustc_private" crates (internal compiler crates).
// Those crates are permanently unstable so it makes no sense to render "unstable" everywhere.
if let Some(stab) = item.stability.as_ref().filter(|stab| {
stab.level == stability::Unstable && stab.feature.as_deref() != Some("rustc_private")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we should be comparing against rustc_span::sym::rustc_private to avoid hitting the string interner lock here.

Copy link
Contributor Author

@tesuji tesuji Jul 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love to. But stab.feature is Option<String>. I have a discussion for merging Stability and more between rustdoc and rustc APIs https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Merge.20Stability.20in.20rustc_attr.20and.20rustdoc .

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right this is rustdoc-cleaned stability. Fine as is then.

@Mark-Simulacrum
Copy link
Member

r=me with nit resolved (where I left the comment and elsewhere in modified code)

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 15, 2020
@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jul 16, 2020

📌 Commit 47fea96 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 16, 2020
This was referenced Jul 17, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 17, 2020
…arth

Rollup of 8 pull requests

Successful merges:

 - rust-lang#73101 (Resolve items for cross-crate imports relative to the original module)
 - rust-lang#73269 (Enable some timeouts in SGX platform)
 - rust-lang#74033 (Add build support for Cargo's build-std feature.)
 - rust-lang#74351 (Do not render unstable items for rustc doc)
 - rust-lang#74357 (Some `Symbol` related improvements)
 - rust-lang#74371 (Improve ayu rustdoc theme)
 - rust-lang#74386 (Add RISC-V GNU/Linux to src/tools/build-manifest as a host platform)
 - rust-lang#74398 (Clean up E0723 explanation)

Failed merges:

r? @ghost
@bors bors merged commit 0e70884 into rust-lang:master Jul 17, 2020
@tesuji tesuji deleted the remove-rustc-internal-compiler-warns branch July 17, 2020 03:39
@cuviper cuviper added this to the 1.47.0 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: Hide nightly-only messages on doc.rust-lang.org/nightly-rustc
7 participants