about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authoronur-ozkan <work@onurozkan.dev>2024-08-14 08:04:02 +0300
committeronur-ozkan <work@onurozkan.dev>2024-08-14 08:04:02 +0300
commitb76f6a3b1a5124e4ade1e54299e74e3026192196 (patch)
treefbdaef7c8ca11a547fb5efcb74ffa01a01f3e623 /src/bootstrap
parent0518e8c7fd8c7e890b7a3f603944136374596639 (diff)
downloadrust-b76f6a3b1a5124e4ade1e54299e74e3026192196.tar.gz
rust-b76f6a3b1a5124e4ade1e54299e74e3026192196.zip
print values of incompatible options
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/src/core/config/config.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
index 2f28d1d2cbe..6dc3e69d8ba 100644
--- a/src/bootstrap/src/core/config/config.rs
+++ b/src/bootstrap/src/core/config/config.rs
@@ -47,7 +47,7 @@ pub enum DryRun {
     UserSelected,
 }
 
-#[derive(Copy, Clone, Default, PartialEq, Eq)]
+#[derive(Copy, Clone, Default, Debug, Eq, PartialEq)]
 pub enum DebuginfoLevel {
     #[default]
     None,
@@ -117,7 +117,7 @@ impl Display for DebuginfoLevel {
 /// 2) MSVC
 /// - Self-contained: `-Clinker=<path to rust-lld>`
 /// - External: `-Clinker=lld`
-#[derive(Copy, Clone, Default, PartialEq)]
+#[derive(Copy, Clone, Default, Debug, PartialEq)]
 pub enum LldMode {
     /// Do not use LLD
     #[default]
@@ -2667,11 +2667,14 @@ fn check_incompatible_options_for_ci_rustc(
 ) -> Result<(), String> {
     macro_rules! err {
         ($current:expr, $expected:expr) => {
-            if let Some(current) = $current {
-                if Some(current) != $expected {
+            if let Some(current) = &$current {
+                if Some(current) != $expected.as_ref() {
                     return Err(format!(
-                        "ERROR: Setting `rust.{}` is incompatible with `rust.download-rustc`.",
-                        stringify!($expected).replace("_", "-")
+                        "ERROR: Setting `rust.{}` is incompatible with `rust.download-rustc`. \
+                        Current value: {:?}, Expected value(s): None/{:?}",
+                        stringify!($expected).replace("_", "-"),
+                        $current,
+                        $expected
                     ));
                 };
             };