Skip to content

rustdoc-args is ignored for proc_macro crates #2374

Open

Description

Crate name

attr_alias

Build failure link

https://docs.rs/crate/attr_alias/0.1.0/builds/1075851

Additional details

The build did not fail, but this still appeared to be the best template, as the build did not work as expected.

For proc_macro crates, docs.rs avoids passing --target for builds:

if !metadata.proc_macro {
cargo_args.push("--target".into());
cargo_args.push(target.into());
};

From what I can tell, for library crates, this fixes an issue of rustdoc-args being ignored when passed as build.rustdocflags to rustdoc. However, regardless of whether --target is passed, rustdoc-args is ignored for proc_macro crates.

For example, Cargo.toml for attr_alias includes:

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "attr_alias_docs_rs"]

attr_alias::attr_alias also has the attribute:

#[cfg_attr(attr_alias_docs_rs, doc(cfg(feature = "nightly")))]

Therefore, attr_alias::attr_alias should be documented to require the "nightly" feature, but the note is missing, since rustdoc-args was ignored:
https://docs.rs/attr_alias/0.1.0/attr_alias/attr.attr_alias.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-buildsArea: Building the documentation for a crateC-bugCategory: This is a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions