Skip to content

Commit

Permalink
fix(cli): Ensure we don't accidentally let embedded manifests on stable
Browse files Browse the repository at this point in the history
There should be a later check when parsing but just in case, let's have
a check here as well.
  • Loading branch information
epage committed Jun 20, 2023
1 parent 7b5fe7b commit 1a86b76
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cargo/util/command_prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 1a86b76

Please sign in to comment.