Fix build failure in cfg-if

This commit is contained in:
Guillaume Gomez 2024-06-28 20:45:02 +02:00 committed by Antoni Boucher
parent bbc765b49b
commit 2ecab996f8

View File

@ -703,12 +703,16 @@ fn test_projects(env: &Env, args: &TestArg) -> Result<(), String> {
//"https://github.com/rust-lang/cargo", // TODO: very slow, only run on master? //"https://github.com/rust-lang/cargo", // TODO: very slow, only run on master?
]; ];
let mut env = env.clone();
let rustflags =
format!("{} --cap-lints allow", env.get("RUSTFLAGS").cloned().unwrap_or_default());
env.insert("RUSTFLAGS".to_string(), rustflags);
let run_tests = |projects_path, iter: &mut dyn Iterator<Item = &&str>| -> Result<(), String> { let run_tests = |projects_path, iter: &mut dyn Iterator<Item = &&str>| -> Result<(), String> {
for project in iter { for project in iter {
let clone_result = git_clone_root_dir(project, projects_path, true)?; let clone_result = git_clone_root_dir(project, projects_path, true)?;
let repo_path = Path::new(&clone_result.repo_dir); let repo_path = Path::new(&clone_result.repo_dir);
run_cargo_command(&[&"build", &"--release"], Some(repo_path), env, args)?; run_cargo_command(&[&"build", &"--release"], Some(repo_path), &env, args)?;
run_cargo_command(&[&"test"], Some(repo_path), env, args)?; run_cargo_command(&[&"test"], Some(repo_path), &env, args)?;
} }
Ok(()) Ok(())