Add minimal support for cargo scripts

This commit is contained in:
hkalbasi 2023-08-14 01:30:59 +03:30 committed by Lukas Wirth
parent 50bdeaad07
commit 2f828073aa
8 changed files with 238 additions and 16 deletions

View file

@ -305,6 +305,10 @@ impl CargoWorkspace {
.collect(),
);
}
if cargo_toml.extension().is_some_and(|x| x == "rs") {
// TODO: enable `+nightly` for cargo scripts
other_options.push("-Zscript".to_owned());
}
meta.other_options(other_options);
// FIXME: Fetching metadata is a slow process, as it might require