Skip to content

Commit 1ea02ff

Browse files
committed
Auto merge of #14670 - Rustin170506:rustin-patch-script, r=epage
Remove the support for `Cargo.toml` of the cargo-script
2 parents ab71ba9 + 76cd19b commit 1ea02ff

File tree

2 files changed

+1
-25
lines changed

2 files changed

+1
-25
lines changed

src/bin/cargo/commands/run.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ pub fn exec(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult {
9090
/// See also `util/toml/mod.rs`s `is_embedded`
9191
pub fn is_manifest_command(arg: &str) -> bool {
9292
let path = Path::new(arg);
93-
1 < path.components().count()
94-
|| path.extension() == Some(OsStr::new("rs"))
95-
|| path.file_name() == Some(OsStr::new("Cargo.toml"))
93+
1 < path.components().count() || path.extension() == Some(OsStr::new("rs"))
9694
}
9795

9896
pub fn exec_manifest_command(gctx: &mut GlobalContext, cmd: &str, args: &[OsString]) -> CliResult {

tests/testsuite/script.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -68,28 +68,6 @@ args: []
6868
.run();
6969
}
7070

71-
#[cargo_test]
72-
fn basic_cargo_toml() {
73-
let p = cargo_test_support::project()
74-
.file("src/main.rs", ECHO_SCRIPT)
75-
.build();
76-
77-
p.cargo("-Zscript -v Cargo.toml")
78-
.masquerade_as_nightly_cargo(&["script"])
79-
.with_stdout_data(str![[r#"
80-
bin: target/debug/foo[EXE]
81-
args: []
82-
83-
"#]])
84-
.with_stderr_data(str![[r#"
85-
[COMPILING] foo v0.0.1 ([ROOT]/foo)
86-
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
87-
[RUNNING] `target/debug/foo[EXE]`
88-
89-
"#]])
90-
.run();
91-
}
92-
9371
#[cargo_test]
9472
fn path_required() {
9573
let p = cargo_test_support::project()

0 commit comments

Comments
 (0)