Skip to content

Rust Documentation: feature flag requirements not showing on docs.rs? #6123

@n8henrie

Description

@n8henrie

tldr: feature flag requirements (e.g. .diff() requires the diff feature) are showing up when I build docs locally and on GitHub Pages but not on docs.rs for some reason.

polars (rust) has a lot of feature flags, and I was having a little difficulty* figuring out which ones I was missing to get things to compile in polars-rust that I had working in polars-python. This led me to start a conversation on Reddit which helped me realize that:

I was wondering if there could perhaps be some kind of configuration on docs.rs or rustdoc that enables this, and was able to find:

Taking a look at your GA workflow, it builds locally with the feature flag requirements displayed: RUSTFLAGS="--cfg docsrs" cargo doc --features=docs-selection --package polars --open.

Comparing to axum, I don't see huge differences for why their feature requirements are being displayed on docs.rs and polars is not, except that they are using all-features = true where as polars uses features = ["docs-selection"] in Cargo.toml; building locally still shows the feature flag requirements, so that doesn't seem to be the issue.

Any ideas why the feature flag requirements aren't showing up on docs.rs?

* in spite of great documentation such as https://pola-rs.github.io/polars/polars/index.html#compile-times-and-opt-in-features

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions