Skip to content

Revamp rustdoc docs about documentation using cfg - #76855

Merged
bors merged 1 commit into
rust-lang:masterfrom
jyn514:platform-specific
Oct 6, 2020
Merged

Revamp rustdoc docs about documentation using cfg#76855
bors merged 1 commit into
rust-lang:masterfrom
jyn514:platform-specific

Conversation

@jyn514

@jyn514jyn514 commented Sep 17, 2020

Copy link
Copy Markdown
Member
  • Move cfg(doc) out of unstable-features. It's not unstable.
  • Remove outdated reference to everybody_loops.
  • Improve wording in various places
  • Give an example of code this allows (and does not allow)
  • Link to cfg(doc) in doc(cfg) documentation. Since one is stable
    and the other is not, don't combine them.
  • Cleanup wording for doc(cfg)
  • Incorporate changes from Remove weird looking dashes #76849
  • Mention that doc(cfg) is also for features

Addresses #76849 (comment).
Obsoletes #76849 (I made sure to fix the weird dashes too).
r? @steveklabnik

@jyn514jyn514 added T-rustdoc Relevant to the rustdoc 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 labels Sep 17, 2020
@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 17, 2020
@jyn514jyn514 mentioned this pull request Sep 17, 2020
@ollie27

ollie27 commented Sep 18, 2020

Copy link
Copy Markdown
Contributor
* Move it out of `unstable-features`. It's not unstable.

#[doc(cfg(...))] is still unstable so why were its docs moved?

@jyn514

Copy link
Copy Markdown
MemberAuthor

Hmm, you're right that doc(cfg) is unstable, but it seems like it should go near the section on cfg(doc) since they're often used together. Maybe I could say in advanced-features that doc(cfg) is unstable and have a short paragraph linking there from unstable-features?

@steveklabnik

Copy link
Copy Markdown
Contributor

Hmm, you're right that doc(cfg) is unstable, but it seems like it should go near the section on cfg(doc) since they're often used together. Maybe I could say in advanced-features that doc(cfg) is unstable and have a short paragraph linking there from unstable-features?

Traditionally, we keep a very clean separation here; we only talk about stable things in stable docs, and unstable things in unstable docs.

However, I think the rustdoc team should document its tool the way it wants to, and this is an odd case. I'm fine with this either way.

@jyn514

Copy link
Copy Markdown
MemberAuthor

Ok, I moved doc(cfg) back to unstable-features.md with a link to cfg(doc).

@jyn514
jyn514force-pushed the platform-specific branch 2 times, most recently from 2787f9d to bc12abeCompareSeptember 18, 2020 14:18
@jyn514

Copy link
Copy Markdown
MemberAuthor

ping @ollie27 - does the new documentation look good to you?

Comment threadsrc/doc/rustdoc/src/advanced-features.md Outdated
Comment threadsrc/doc/rustdoc/src/advanced-features.md Outdated
Comment threadsrc/doc/rustdoc/src/advanced-features.md Outdated
Comment threadsrc/doc/rustdoc/src/unstable-features.md Outdated
@ollie27ollie27 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 Sep 28, 2020
@jyn514jyn514 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 28, 2020

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I'm not super happy with this wording, but I'm not sure how better to say it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Conditional documentation?

@jyn514jyn514Sep 28, 2020

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

No, the documentation is usually unconditional, e.g. cfg(any(doc, unix)), but the code is only present when the cfg is set.

@jyn514

Copy link
Copy Markdown
MemberAuthor

r? @ollie27

Comment threadsrc/doc/rustdoc/src/advanced-features.md Outdated

@ollie27ollie27 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me. r=me with that one typo fixed and the commits squashed.

Comment threadsrc/doc/rustdoc/src/advanced-features.md Outdated
@ollie27ollie27 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 Oct 5, 2020
- Move `cfg(doc)` out of `unstable-features`. It's not unstable.
- Remove outdated reference to `everybody_loops`.
- Improve wording in various places
- Give an example of code this allows (and does not allow)
- Link to `cfg(doc)` in `doc(cfg)` documentation. Since one is stable
and the other is not, don't combine them.
- Cleanup wording for `doc(cfg)`
- Incorporate changes from rust-lang#76849
- Mention that `doc(cfg)` is also for features
@jyn514

Copy link
Copy Markdown
MemberAuthor

@bors r=ollie27 rollup

@bors

bors commented Oct 5, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit dc5a000 has been approved by ollie27

@borsbors 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 Oct 5, 2020
@JohnTitorJohnTitor mentioned this pull request Oct 6, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 6, 2020
Rollup of 13 pull requests
Successful merges:
- rust-lang#76388 (Add a note about the panic behavior of math operations on time objects)
- rust-lang#76855 (Revamp rustdoc docs about documentation using `cfg`)
- rust-lang#76995 (Reduce boilerplate with the matches! macro)
- rust-lang#77228 (Add missing examples for MaybeUninit)
- rust-lang#77528 (Avoid unchecked casts in net parser)
- rust-lang#77534 (Disallow overriding forbid in same scope)
- rust-lang#77555 (Allow anyone to set regression labels)
- rust-lang#77558 (Rename bootstrap/defaults/{config.toml.PROFILE => config.PROFILE.toml})
- rust-lang#77559 (Fix rustdoc warnings about invalid Rust syntax)
- rust-lang#77560 (Fix LitKind's byte buffer to use refcounted slice)
- rust-lang#77573 (Hint doc use convert::identity relative link)
- rust-lang#77587 (Fix span for unicode escape suggestion.)
- rust-lang#77591 (Record `expansion_that_defined` into crate metadata)
Failed merges:
r? `@ghost`
@bors
bors merged commit 97ee62c into rust-lang:masterOct 6, 2020
@rustbotrustbot added this to the 1.49.0 milestone Oct 6, 2020
@jyn514
jyn514 deleted the platform-specific branch February 25, 2023 18:32
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsS-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@jyn514@ollie27@steveklabnik@bors@pickfire@rust-highfive@rustbot