Hide experimental features in std docs

Is there any "official" way to do so? I'm aware of this forum post, some time has passed since then and maybe there's some better way to exclude experimental features? Or maybe I can somehow render it locally excluding them?


Apparently Docs.rs already hides features prefixed with _, according to this issue. There's a feature request for public/private features, so you might be able to have more explicit control over hiding features in the future.

Both links you gave seem to be about library features (the ones you can list in your dependencies in Cargo.toml) whereas OP was asking about #[feature(foo)] language features for unstable API in std that can be accessed on nightly.

1 Like

Oops, you're right, I misread the question.

Why would you want to rob yourself of that sweet, sweet frustration when you discover that Exactly What You Need Exists But Is Not Stable? Every Rust developer knows and loves this feeling. Once you're gotten past that initial borrow-checker rage, you'll need something else to fill that void -- let it be nightly-only std functions/methods. :slight_smile:

Laughs in a IoSlice::advance() kind of way


I was trying to add doc(hidden) to everything unstable with as little effort as possible (aka regex) but now my rustdoc invocation panics (ICE) so I'll probably focus on digging into that first.

Edit: Turns out, rustdoc didn’t like[1] a #[doc(hidden)] on the docs for never type, without also removing the special #[rustc_doc_primitive = "never"] attribute. I’ll continue the attempt to doc(hidden) all the unstable stuff in a locally generated standard library documentation, (no earlier than) tomorrow.

  1. by which I mean: it crashes in this case ↩︎


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.