-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add (optional) doc_auto_cfg
attribute to generated library
#855
Comments
Actually, I have issue building this locally without warnings with current nightly. Adding the following snippet to [lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(docs_rs)'] } fixes the warning ,but the documentation still is not built properly.. In any case https://docs.rs/va108xx/0.3.0/va108xx/ shows the end result , with the documentation displaying where the |
After some more research: It is sufficient to use #![cfg_attr(docsrs, feature(doc_auto_cfg))] in the [package.metadata.docs.rs]
rustdoc-args = ["--generate-link-to-definition"] is sufficient now. The old way I used to build this locally does not work anymore. I tested this locally using RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc --all-features --open the old way
does not work anymore for some reason. |
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:The text was updated successfully, but these errors were encountered: