chore: Do not show "Available on non-loom only." doc label#7977
Merged
martin-g merged 6 commits intotokio-rs:masterfrom Mar 18, 2026
Merged
chore: Do not show "Available on non-loom only." doc label#7977martin-g merged 6 commits intotokio-rs:masterfrom
martin-g merged 6 commits intotokio-rs:masterfrom
Conversation
Closes tokio-rs#7976 Uses the unstable #[doc(cfg()]. rust-lang/rust#43781
Member
Member
Author
|
What do you think about replacing |
Darksonn
reviewed
Mar 18, 2026
tokio/src/lib.rs
Outdated
| ))] | ||
| // loom is an internal implementation detail. | ||
| // Do not show "Available on non-loom only" label | ||
| #![cfg_attr(docsrs, doc(cfg(not(loom))))] |
Member
There was a problem hiding this comment.
Does this work?
Suggested change
| #![cfg_attr(docsrs, doc(cfg(not(loom))))] | |
| #![cfg_attr(docsrs, doc(cfg(hide(loom))))] |
Member
Author
There was a problem hiding this comment.
$ RUSTDOCFLAGS="--cfg docsrs --cfg tokio_unstable" cargo +nightly doc --lib --no-deps --document-private-items --features full --open -p tokio
Blocking waiting for file lock on artifact directory
Documenting tokio v1.50.0 (/home/mgrigorov/git/rust/tokio/tokio)
error[E0537]: invalid predicate `hide`
--> tokio/src/lib.rs:20:29
|
20 | #![cfg_attr(docsrs, doc(cfg(hide(loom))))]
| ^^^^^^^^^^
For more information about this error, try `rustc --explain E0537`.
Member
There was a problem hiding this comment.
If not, what about doc(auto_cfg(hide(loom)))
Member
There was a problem hiding this comment.
I was looking at the tests in rust-lang/rust#153964 as a reference.
Member
Author
There was a problem hiding this comment.
doc(auto_cfg(hide(loom))) works!
Member
|
For convenience, docs preview link: |
Darksonn
approved these changes
Mar 18, 2026
Member
|
Feel free to merge once this passes CI. |
mattiapitossi
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation
Do not show "Available on non-loom only." doc label
Closes #7976
Solution
Uses the unstable #[doc(cfg()]. rust-lang/rust#43781