Skip to content

Add (optional) doc_auto_cfg attribute to generated library #855

Open
@robamu

Description

In my crates, I currently use the following code snippet at the top of lib.rs:

#![cfg_attr(docsrs, feature(doc_auto_cfg))]

For documentation built by docs.rs, this explicitly displays required features for modules/functions etc. without requiring additional attributes.
What do you think about adding this to the generated library?

In all my libraries using this, I use the following snippets in Cargo.toml to use this for the docs-rs build:

[package.metadata.docs.rs]
rustdoc-args = ["--generate-link-to-definition"]

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