From 1a86b76828b46cada025cc74952b3aa7e28856d0 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 19 Jun 2023 21:26:49 -0500 Subject: [PATCH] fix(cli): Ensure we don't accidentally let embedded manifests on stable There should be a later check when parsing but just in case, let's have a check here as well. --- src/cargo/util/command_prelude.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cargo/util/command_prelude.rs b/src/cargo/util/command_prelude.rs index 3a64e60feed..666a67b0084 100644 --- a/src/cargo/util/command_prelude.rs +++ b/src/cargo/util/command_prelude.rs @@ -790,6 +790,13 @@ pub fn root_manifest(manifest_path: Option<&Path>, config: &Config) -> CargoResu if !path.exists() { anyhow::bail!("manifest path `{}` does not exist", manifest_path.display()) } + if crate::util::toml::is_embedded(&path) && !config.cli_unstable().script { + return Err(anyhow::anyhow!( + "embedded manifest `{}` requires `-Zscript`", + path.display() + ) + .into()); + } Ok(path) } else { find_root_manifest_for_wd(config.cwd())