diff --git a/src/bin/cargo/commands/install.rs b/src/bin/cargo/commands/install.rs index 010a4f48385d..57063f11dc80 100644 --- a/src/bin/cargo/commands/install.rs +++ b/src/bin/cargo/commands/install.rs @@ -83,6 +83,7 @@ pub fn cli() -> Command { "debug", "Build in debug mode (with the 'dev' profile) instead of release mode", )) + .arg_unsupported_mode("release", "install", "debug") .arg_profile("Install artifacts with the specified profile") .arg_target_triple("Build for the target triple") .arg_target_dir() diff --git a/src/cargo/util/command_prelude.rs b/src/cargo/util/command_prelude.rs index 303f965a74e0..270b558c6c2f 100644 --- a/src/cargo/util/command_prelude.rs +++ b/src/cargo/util/command_prelude.rs @@ -525,7 +525,7 @@ Run `{cmd}` to see possible targets." let name = match ( self.maybe_flag("release"), - self.flag("debug"), + self.maybe_flag("debug"), specified_profile, ) { (false, false, None) => default,