-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
rustdoc should also be passed RUSTFLAGS #4737
Comments
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. |
See rust-lang/rust#46189. |
Could there be a warning when |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: