-
Notifications
You must be signed in to change notification settings - Fork 14k
Description
We're running cargo test for many Rust crates we package in Fedora Linux to ensure they work in our environment and on all CPU architectures that we support. We define RUSTFLAGS="--cap-lints=warn" (among other things) to avoid crates starting to fail to build due to things like #![deny(warnings)] with newer Rust versions that add new lints.
Passing "--cap-lints=warn" with RUSTFLAGS works fine for normal library code and test code, but it doesn't get applied to rustdoc when it checks / compiles doctests, and this often causes problems because many crates use #![deny(warnings)] for their doctests / example code in doc comments.
I tried defining RUSTDOCFLAGS="--cap-lints=warn" in addition to having this flag already present in RUSTFLAGS, it didn't change the behaviour. I tried adding a build.rustdocflags = "--cap-lints=warn" setting to .cargo/config, and it didn't change anything either.
It appears that cargo test --doc isn't passing either RUSTFLAGS or RUSTDOCFLAGS to rustdoc correctly.