From 404fc41b3940af65f00d3897ada8f75a60e0424f Mon Sep 17 00:00:00 2001 From: "Celina G. Val" Date: Fri, 11 Aug 2023 14:23:00 -0700 Subject: [PATCH] Change how we enforce deny warnings (#2672) Enforce that no warning is being added as part of our regression script instead at a crate level. This will also enforce no warnings for all our crates, instead of just kani-compiler as is today. This makes development a bit easier, since warnings of unused code shows up fairly often when a feature is half implemented. So this allow us to compile and test the code before it's production ready. That said, it is nice to avoid warnings from piling up, so change the check to the regression instead, which should be executed before we create PR / merge changes. This also aligns with the recommendation from https://rust-unofficial.github.io/patterns/anti_patterns/deny-warnings.html --- kani-compiler/src/main.rs | 1 - scripts/kani-regression.sh | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/kani-compiler/src/main.rs b/kani-compiler/src/main.rs index 448466ce8d64..ad510bcc7dd8 100644 --- a/kani-compiler/src/main.rs +++ b/kani-compiler/src/main.rs @@ -6,7 +6,6 @@ //! //! Like miri, clippy, and other tools developed on the top of rustc, we rely on the //! rustc_private feature and a specific version of rustc. -#![deny(warnings)] #![feature(extern_types)] #![recursion_limit = "256"] #![feature(box_patterns)] diff --git a/scripts/kani-regression.sh b/scripts/kani-regression.sh index e7089c22c5fd..0567227672ad 100755 --- a/scripts/kani-regression.sh +++ b/scripts/kani-regression.sh @@ -26,8 +26,8 @@ check_kissat_version.sh # Formatting check ${SCRIPT_DIR}/kani-fmt.sh --check -# Build all packages in the workspace -cargo build-dev +# Build all packages in the workspace and ensure no warning is emitted. +RUSTFLAGS="-D warnings" cargo build-dev # Unit tests cargo test -p cprover_bindings