]> git.proxmox.com Git - cargo.git/commitdiff
named-profiles: when -Z unstable-options not specified, don't validate --profile
authorDan Aloni <dan@kernelim.com>
Mon, 7 Oct 2019 20:09:17 +0000 (23:09 +0300)
committerDan Aloni <dan@kernelim.com>
Mon, 7 Oct 2019 20:11:14 +0000 (23:11 +0300)
Fixes #7488.

src/cargo/util/command_prelude.rs

index 2d0a9b3fc5e1c63038a63d3007651030b211989b..4a892cb6bb8cb034aaa68a147e98dfe142557d19 100644 (file)
@@ -322,14 +322,22 @@ pub trait ArgMatchesExt {
         }
 
         if self._is_present("release") {
-            match specified_profile {
-                None | Some(ProfileKind::Release) => Ok(ProfileKind::Release),
-                _ => failure::bail!("Conflicting usage of --profile and --release"),
+            if !config.cli_unstable().unstable_options {
+                Ok(ProfileKind::Release)
+            } else {
+                match specified_profile {
+                    None | Some(ProfileKind::Release) => Ok(ProfileKind::Release),
+                    _ => failure::bail!("Conflicting usage of --profile and --release"),
+                }
             }
         } else if self._is_present("debug") {
-            match specified_profile {
-                None | Some(ProfileKind::Dev) => Ok(ProfileKind::Dev),
-                _ => failure::bail!("Conflicting usage of --profile and --debug"),
+            if !config.cli_unstable().unstable_options {
+                Ok(ProfileKind::Dev)
+            } else {
+                match specified_profile {
+                    None | Some(ProfileKind::Dev) => Ok(ProfileKind::Dev),
+                    _ => failure::bail!("Conflicting usage of --profile and --debug"),
+                }
             }
         } else {
             Ok(specified_profile.unwrap_or(default))