mirror of
https://github.com/tokio-rs/tracing.git
synced 2025-10-02 07:20:35 +00:00

## Motivation Currently, most crates in `tracing` are configured to deny all compiler warnings when compiling tests. This means that if the compiler reports any warnings, the build will fail. This can be an issue when changes are made locally that introduce warnings (i.e. unused code is added, imports are no longer needed, etc) and a contributor wishes to test an incomplete state to ensure their changes are on the right path. With warnings denied, tests will not run if the project contains any warnings, so contributors must either fix all warnings or disable the deny attribute. Disabling the deny attribute when making changes locally has become a fairly common practice, but it's error-prone: sometimes, the deny attribute is commented out and then accidentally committed. ## Solution This branch removes all `#![deny(warnings)]` attributes, in order to allow code with warnings to compile and be tested locally while changes are in progress. We already have [a CI job][1] that checks for compiler warnings by trying to compile `tracing` with `RUSTFLAGS="-Dwarnings"`. If we make this CI job required rather than allowing it to fail, we'll still be able to ensure that no code with warnings is merged. Additionally, I've updated all crates to use the same consistent list of lints to apply in the `#![warn]` attribute. Previously, some crates warned on more lints than others, which is not great. I've fixed all the new warnings produced by the additional lints. * chore: consistent warnings, don't deny locally * fix warnings from new attributes * remove warning that no longer exists on nightly Signed-off-by: Eliza Weisman <eliza@buoyant.io>