Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Make `cargo doc` fail if there are warnings

I’d like to test in CI that cargo doc succeeds without any warnings. Is there any way to get cargo doc to exit with a non-zero exit code if there are warnings?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

This should be helpful. Basically you can pass additional flags to the compiler by setting RUSTFLAGS env variable. So to deny all warnings (for any build type) is as simple as setting RUSTFLAGS="-D warnings".

EDIT. To deny warnings in the generated documentation those flags must be set by RUSTDOCFLAGS env variable instead.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading