diff --git a/src/bin/cargo/commands/run.rs b/src/bin/cargo/commands/run.rs index c9e59770a28..61feefeb34c 100644 --- a/src/bin/cargo/commands/run.rs +++ b/src/bin/cargo/commands/run.rs @@ -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 { diff --git a/tests/testsuite/script.rs b/tests/testsuite/script.rs index e5b3ac75af2..9173ddda9f3 100644 --- a/tests/testsuite/script.rs +++ b/tests/testsuite/script.rs @@ -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()