Persistent warnings from cargo build

Is there a way to get persistent warnings from cargo build, independently of what has been rebuilt in this particular run?

I found this:

But it has been closed as not applicable to cargo. Is there another tool which helps with that?

Alternatively, I would be fine to invoke cargo build with a special option to get the effect of #![deny(warnings)] for the current project sources, so that it’s no longer possible to miss a warning due to partial rebuilds. (I do not want to put #![deny(warnings)] into the source tree for obvious reasons.)

Will incremental compilation suppress additional warnings in bits which that aren’t recompiled?

To deny all warnings without changing the source, you can set RUSTFLAGS=-Dwarnings.

2 Likes