You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know about RUSTDOCFLAGS, but I would like to understand the rationale against passing RUSTFLAGS to rustdoc when running cargo test.
My use case is the following: I'm using unstable Rust code in a 1.0 crate, and I want to cfg-gate it like Rayon does with RUSTFLAGS="--cfg rayon_unstable". It works great, but my issue is that some code that is now using unstable Rust is tested through doc tests and given rustdoc isn't passed RUSTFLAGS, putting # #![cfg_attr(foo_unstable, feature(some_unstable_feature))] in the doc test does nothing and it fails.
The text was updated successfully, but these errors were encountered:
This unfortunately cannot be done because rustdoc does not support all of rustc's flags, and I think supporting that would be an upstream rust-lang/rust issue.
Could there be a warning when RUSTFLAGS is set for doc? I just spent a lot of time trying to figure out why it doesn't work for me. Would be nice to at least save others.
I know about
RUSTDOCFLAGS
, but I would like to understand the rationale against passingRUSTFLAGS
torustdoc
when runningcargo test
.My use case is the following: I'm using unstable Rust code in a 1.0 crate, and I want to cfg-gate it like Rayon does with
RUSTFLAGS="--cfg rayon_unstable"
. It works great, but my issue is that some code that is now using unstable Rust is tested through doc tests and givenrustdoc
isn't passedRUSTFLAGS
, putting# #![cfg_attr(foo_unstable, feature(some_unstable_feature))]
in the doc test does nothing and it fails.The text was updated successfully, but these errors were encountered: