Open ignatenkobrain opened 4 years ago
Transferred to rust-lang/rust
, as this seems to be an issue with rustdoc --test
doesn't propagate --cap-lints
to the tests.
We are still getting bitten by this. Especially because some projects appear to apply stricter linting settings to their doctests / example code snippets in doc comments than they do in their actual code ...
IMO, deny(warnings)
checked-in to the repo is an anti-pattern. It's quite annoying when you use a slightly different version of the toolchain than CI and then can't even build the project -- adding new warnings is explicitly not a breaking change after all. So it'd be entirely reasonable to report bugs with these projects asking them to remove the deny(warnings)
from the sources (and I've done this in the past).
That said, some projects will not follow best practices, so there should still be a way to deal with that. I'm not quite sure what happens here -- doesn't the rustc
invoked by rustdoc
get passed RUSTFLAGS? It seems like it does not, but then I wonder why that doesn't break a lot more often.
Problem
I am trying to package async-std crates for Fedora and that includes running tests for them. I learned that they fail because
#![feature(async_await)]
is used. We are passing--cap-lints=warn
in RUSTFLAGS, but that seems to be not enough. I have tried setting RUSTDOCFLAGS to pass this argument, but that does not seem to be respected.Steps
--cap-lints=warn
in RUSTFLAGS and RUSTDOCFLAGSPossible Solution(s)
I did not look into the code, but I believe it just does not get propagated somewhere.
Notes
Output of
cargo version
:cargo 1.39.0
This is happening on x86_64 on Fedora with its compiler, but I am pretty sure this will happen with rustup compiler too.