Revamp rustdoc docs about documentation using cfg#76855
Revamp rustdoc docs about documentation using cfg#76855bors merged 1 commit intorust-lang:masterfrom
cfg#76855Conversation
|
|
Hmm, you're right that |
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. |
|
Ok, I moved |
2787f9d to
bc12abe
Compare
|
ping @ollie27 - does the new documentation look good to you? |
There was a problem hiding this comment.
I'm not super happy with this wording, but I'm not sure how better to say it.
There was a problem hiding this comment.
Conditional documentation?
There was a problem hiding this comment.
No, the documentation is usually unconditional, e.g. cfg(any(doc, unix)), but the code is only present when the cfg is set.
|
r? @ollie27 |
ollie27
left a comment
There was a problem hiding this comment.
Looks good to me. r=me with that one typo fixed and the commits squashed.
a3352dc to
3c7433d
Compare
- 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
3c7433d to
dc5a000
Compare
|
@bors r=ollie27 rollup |
|
📌 Commit dc5a000 has been approved by |
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`
cfg(doc)out ofunstable-features. It's not unstable.everybody_loops.cfg(doc)indoc(cfg)documentation. Since one is stableand the other is not, don't combine them.
doc(cfg)doc(cfg)is also for featuresAddresses #76849 (comment).
Obsoletes #76849 (I made sure to fix the weird dashes too).
r? @steveklabnik