From fc0aa4f7b1abcf6870dc6c85f234558c40de24f7 Mon Sep 17 00:00:00 2001 From: targrub <62773321+targrub@users.noreply.github.com> Date: Fri, 1 Mar 2024 13:25:19 -0500 Subject: [PATCH] Explicitly run `+nightly` for `-Zcheck-cfg` pass in ci. (#12230) # Objective Getting this error running ci locally. ``` $ cargo check -Zcheck-cfg --workspace error: the `-Z` flag is only accepted on the nightly channel of Cargo, but this is the `stable` channel See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more information about Rust release channels. thread 'main' panicked at tools\ci\src\main.rs:166:14: Please fix failing cfg checks in output above.: command exited with non-zero code `cargo check -Zcheck-cfg --workspace`: 101 ``` ## Solution - Add `+nightly` flag to the `check-cfg` pass. --- Obviously we shouldn't be running `nightly` Cargo, but at least now local running of `cargo run -p ci` will pass. --- tools/ci/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci/src/main.rs b/tools/ci/src/main.rs index c01112987b..4f6886ad61 100644 --- a/tools/ci/src/main.rs +++ b/tools/ci/src/main.rs @@ -161,7 +161,7 @@ fn main() { if what_to_run.contains(Check::CFG_CHECK) { // Check cfg and imports std::env::set_var("RUSTFLAGS", "-D warnings"); - cmd!(sh, "cargo check -Zcheck-cfg --workspace") + cmd!(sh, "cargo +nightly check -Zcheck-cfg --workspace") .run() .expect("Please fix failing cfg checks in output above."); }