Hi,
I've used #![cfg_attr(docsrs, feature(doc_cfg))] and #[cfg_attr(docsrs, doc(cfg(feature = "my_flag")))] like Tokio does.
Added in Cargo.toml :
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
Now I'm wondering how do I test that locally before pushing everything on crates.io?
Thanks!
You can pass the cfg directly while building docs using cargo by setting the environment variable RUSTFLAGS="--cfg docsrs"
1 Like
I had to use RUSTDOCFLAGS but that was the solution
thanks!
1 Like
system
Closed
5
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.