From f58bd11382ec19f740a641695a1ebc5bf945bcb3 Mon Sep 17 00:00:00 2001 From: BD103 <59022059+BD103@users.noreply.github.com> Date: Fri, 4 Oct 2024 09:19:53 -0400 Subject: [PATCH] feat: use rust toolchain specified in `build.rs` --- bevy_lint/tests/ui.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bevy_lint/tests/ui.rs b/bevy_lint/tests/ui.rs index a6cb09ef..bde867f0 100644 --- a/bevy_lint/tests/ui.rs +++ b/bevy_lint/tests/ui.rs @@ -1,6 +1,9 @@ use std::path::{Path, PathBuf}; use ui_test::{color_eyre::{self, eyre::ensure}, run_tests, CommandBuilder, Config}; +// This is set by `build.rs`. It is the version specified in `rust-toolchain.toml`. +const RUST_TOOLCHAIN_CHANNEL: &str = env!("RUST_TOOLCHAIN_CHANNEL"); + fn main() -> color_eyre::Result<()> { let config = config()?; run_tests(config) @@ -24,8 +27,7 @@ fn config() -> color_eyre::Result { program: "rustup".into(), args: vec![ "run".into(), - // TODO: Use `build.rs` to change this dynamically. - "nightly-2024-08-21".into(), + RUST_TOOLCHAIN_CHANNEL.into(), DRIVER_PATH.into(), // `bevy_lint_driver` expects the first argument to be the path to `rustc`. "rustc".into(),