From 56dd5d027e6ecd33f0e96f83363218c5fc8199d8 Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Mon, 4 Sep 2023 18:05:29 +1200 Subject: [PATCH 1/3] Add CARGO_INCREMENTAL=0 to work around clippy 1.72 bug --- .github/scripts/ci-style.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/scripts/ci-style.sh b/.github/scripts/ci-style.sh index eb9ccf49ec..99a314dd53 100755 --- a/.github/scripts/ci-style.sh +++ b/.github/scripts/ci-style.sh @@ -1,6 +1,9 @@ . $(dirname "$0")/ci-common.sh export RUSTFLAGS="-D warnings -A unknown-lints" +# Workaround the clippy issue on Rust 1.72: https://github.com/mmtk/mmtk-core/issues/929. +# If we are not testing with Rust 1.72, or there is no problem running the following clippy checks, we can remove this export. +export CARGO_INCREMENTAL=0 # --- Check main crate --- From e41075b07355b46a0e339bc5b2c4e630bab55660 Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Mon, 4 Sep 2023 18:29:07 +1200 Subject: [PATCH 2/3] Only apply the workaround for clippy 0.1.72 --- .github/scripts/ci-style.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/scripts/ci-style.sh b/.github/scripts/ci-style.sh index 99a314dd53..077c08e599 100755 --- a/.github/scripts/ci-style.sh +++ b/.github/scripts/ci-style.sh @@ -1,9 +1,13 @@ . $(dirname "$0")/ci-common.sh export RUSTFLAGS="-D warnings -A unknown-lints" + # Workaround the clippy issue on Rust 1.72: https://github.com/mmtk/mmtk-core/issues/929. # If we are not testing with Rust 1.72, or there is no problem running the following clippy checks, we can remove this export. -export CARGO_INCREMENTAL=0 +CLIPPY_VERSION=$(cargo clippy --version) +if [[ $CLIPPY_VERSION == "clippy 0.1.72"* ]]; then + export CARGO_INCREMENTAL=0 +fi # --- Check main crate --- From f8aae64a377c859b78fe9f1f13622911d67cd417 Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Mon, 4 Sep 2023 18:33:32 +1200 Subject: [PATCH 3/3] Allow clippy::assertions_on_constants for tests --- src/util/metadata/side_metadata/spec_defs.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/metadata/side_metadata/spec_defs.rs b/src/util/metadata/side_metadata/spec_defs.rs index bcdf678b0d..be7a7730d3 100644 --- a/src/util/metadata/side_metadata/spec_defs.rs +++ b/src/util/metadata/side_metadata/spec_defs.rs @@ -100,6 +100,9 @@ define_side_metadata_specs!( #[cfg(test)] mod tests { + // We assert on constants to test if the macro is working properly. + #![allow(clippy::assertions_on_constants)] + use super::*; #[test] fn first_global_spec() {