Skip to content

Commit

Permalink
Auto merge of #14670 - Rustin170506:rustin-patch-script, r=epage
Browse files Browse the repository at this point in the history
Remove the support for `Cargo.toml` of the cargo-script
  • Loading branch information
bors committed Oct 11, 2024
2 parents ab71ba9 + 76cd19b commit 1ea02ff
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
4 changes: 1 addition & 3 deletions src/bin/cargo/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ pub fn exec(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult {
/// See also `util/toml/mod.rs`s `is_embedded`
pub fn is_manifest_command(arg: &str) -> bool {
let path = Path::new(arg);
1 < path.components().count()
|| path.extension() == Some(OsStr::new("rs"))
|| path.file_name() == Some(OsStr::new("Cargo.toml"))
1 < path.components().count() || path.extension() == Some(OsStr::new("rs"))
}

pub fn exec_manifest_command(gctx: &mut GlobalContext, cmd: &str, args: &[OsString]) -> CliResult {
Expand Down
22 changes: 0 additions & 22 deletions tests/testsuite/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,28 +68,6 @@ args: []
.run();
}

#[cargo_test]
fn basic_cargo_toml() {
let p = cargo_test_support::project()
.file("src/main.rs", ECHO_SCRIPT)
.build();

p.cargo("-Zscript -v Cargo.toml")
.masquerade_as_nightly_cargo(&["script"])
.with_stdout_data(str![[r#"
bin: target/debug/foo[EXE]
args: []
"#]])
.with_stderr_data(str![[r#"
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[RUNNING] `target/debug/foo[EXE]`
"#]])
.run();
}

#[cargo_test]
fn path_required() {
let p = cargo_test_support::project()
Expand Down

0 comments on commit 1ea02ff

Please sign in to comment.