1
Fork 0

improve config::check_incompatible_options_for_ci_rustc logs

Signed-off-by: onur-ozkan <work@onurozkan.dev>
This commit is contained in:
onur-ozkan 2024-08-14 11:11:40 +03:00
parent 4d13470834
commit 151e8cd2f8

View file

@ -2681,10 +2681,11 @@ fn check_incompatible_options_for_ci_rustc(
if Some(current) != $expected.as_ref() { if Some(current) != $expected.as_ref() {
return Err(format!( return Err(format!(
"ERROR: Setting `rust.{}` is incompatible with `rust.download-rustc`. \ "ERROR: Setting `rust.{}` is incompatible with `rust.download-rustc`. \
Current value: {:?}, Expected value(s): None/{:?}", Current value: {:?}, Expected value(s): {}{:?}",
stringify!($expected).replace("_", "-"), stringify!($expected).replace("_", "-"),
$current, $current,
$expected if $expected.is_some() { "None/" } else { "" },
$expected,
)); ));
}; };
}; };
@ -2693,11 +2694,15 @@ fn check_incompatible_options_for_ci_rustc(
macro_rules! warn { macro_rules! warn {
($current:expr, $expected:expr) => { ($current:expr, $expected:expr) => {
if let Some(current) = $current { if let Some(current) = &$current {
if Some(current) != $expected { if Some(current) != $expected.as_ref() {
println!( println!(
"WARNING: `rust.{}` has no effect with `rust.download-rustc`.", "WARNING: `rust.{}` has no effect with `rust.download-rustc`. \
stringify!($expected).replace("_", "-") Current value: {:?}, Expected value(s): {}{:?}",
stringify!($expected).replace("_", "-"),
$current,
if $expected.is_some() { "None/" } else { "" },
$expected,
); );
}; };
}; };