Skip to content

rustdoc: display doc(cfg(false)) properly #141747

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

Merged
merged 1 commit into from
May 30, 2025

Conversation

lolbinarycat
Copy link
Contributor

before we had an extra 'on' that was
ungramatical.

fixes #138112

this is what it looks like now:
screenshot: Available nowhere

before we had an extra 'on' that was
ungramatical.

fixes rust-lang#138112
@rustbot
Copy link
Collaborator

rustbot commented May 29, 2025

r? @GuillaumeGomez

rustbot has assigned @GuillaumeGomez.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels May 29, 2025
@GuillaumeGomez
Copy link
Member

Thanks!

r=me once CI pass.

@bors delegate=lolbinarycat

@bors
Copy link
Collaborator

bors commented May 29, 2025

✌️ @lolbinarycat, you can now approve this pull request!

If @GuillaumeGomez told you to "r=me" after making some further change, please make that change, then do @bors r=@GuillaumeGomez

@lolbinarycat
Copy link
Contributor Author

@bors r=@GuillaumeGomez

@bors
Copy link
Collaborator

bors commented May 29, 2025

📌 Commit c6eb1d9 has been approved by GuillaumeGomez

It is now in the queue for this repository.

@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-review Status: Awaiting review from the assignee but also interested parties. labels May 29, 2025
@@ -171,10 +171,15 @@ impl Cfg {

/// Renders the configuration for long display, as a long HTML description.
pub(crate) fn render_long_html(&self) -> String {
let on = if self.should_use_with_in_description() { "with" } else { "on" };
let on = if self.omit_preposition() {
Copy link
Member

Choose a reason for hiding this comment

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

The render_long_plain function below should also have this change applied. Really it seems like we could extract a shared function that they both delegate to since the only difference is the format AFAICT.

Copy link
Member

Choose a reason for hiding this comment

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

Good point, sending a PR.

bors added a commit that referenced this pull request May 30, 2025
Rollup of 8 pull requests

Successful merges:

 - #133823 (Use `cfg_attr_trace` in AST with a placeholder attribute for accurate suggestion)
 - #141004 (Report text_direction_codepoint_in_literal when parsing)
 - #141407 (Refactor the two-phase check for impls and impl items)
 - #141430 (remove `visit_clobber` and move `DummyAstNode` to `rustc_expand`)
 - #141507 (atomic_load intrinsic: use const generic parameter for ordering)
 - #141538 (implement `va_arg` for x86_64 systemv)
 - #141669 (float: Replace some approximate assertions with exact)
 - #141747 (rustdoc: display doc(cfg(false)) properly)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 71529f5 into rust-lang:master May 30, 2025
9 checks passed
rust-timer added a commit that referenced this pull request May 30, 2025
Rollup merge of #141747 - lolbinarycat:rustdoc-cfg-138112, r=GuillaumeGomez

rustdoc: display doc(cfg(false)) properly

before we had an extra 'on' that was
ungramatical.

fixes #138112

this is what it looks like now:
![screenshot: Available nowhere](https://github.com/user-attachments/assets/e27b4990-09a7-4f13-8bcf-26d44c8c1bea)
@rustbot rustbot added this to the 1.89.0 milestone May 30, 2025
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request May 31, 2025
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#133823 (Use `cfg_attr_trace` in AST with a placeholder attribute for accurate suggestion)
 - rust-lang/rust#141004 (Report text_direction_codepoint_in_literal when parsing)
 - rust-lang/rust#141407 (Refactor the two-phase check for impls and impl items)
 - rust-lang/rust#141430 (remove `visit_clobber` and move `DummyAstNode` to `rustc_expand`)
 - rust-lang/rust#141507 (atomic_load intrinsic: use const generic parameter for ordering)
 - rust-lang/rust#141538 (implement `va_arg` for x86_64 systemv)
 - rust-lang/rust#141669 (float: Replace some approximate assertions with exact)
 - rust-lang/rust#141747 (rustdoc: display doc(cfg(false)) properly)

r? `@ghost`
`@rustbot` modify labels: rollup
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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustdoc with doc(cfg(false)) prints an extra "on"
5 participants