diff --git a/src/cargo/util/toml/mod.rs b/src/cargo/util/toml/mod.rs
index 85aeb8697a7..9459fc6c37b 100644
--- a/src/cargo/util/toml/mod.rs
+++ b/src/cargo/util/toml/mod.rs
@@ -45,9 +45,10 @@ pub use embedded::ScriptSource;
 /// See also `bin/cargo/commands/run.rs`s `is_manifest_command`
 pub fn is_embedded(path: &Path) -> bool {
     let ext = path.extension();
-    ext == Some(OsStr::new("rs")) ||
+    (ext == Some(OsStr::new("rs")) ||
         // Provide better errors by not considering directories to be embedded manifests
-        (ext.is_none() && path.is_file())
+        ext.is_none())
+        && path.is_file()
 }
 
 /// Loads a `Cargo.toml` from a file on disk.
diff --git a/tests/testsuite/package.rs b/tests/testsuite/package.rs
index 0263607449c..0d2244234c1 100644
--- a/tests/testsuite/package.rs
+++ b/tests/testsuite/package.rs
@@ -6596,6 +6596,78 @@ fn workspace_with_renamed_member() {
         .run();
 }
 
+#[cargo_test]
+fn workspace_with_dot_rs_dir() {
+    let reg = registry::init();
+
+    let p = project()
+        .file(
+            "Cargo.toml",
+            r#"
+            [workspace]
+            members = ["crates/*"]
+            "#,
+        )
+        .file(
+            "crates/foo.rs/Cargo.toml",
+            r#"
+            [package]
+            name = "foo"
+            version = "0.16.2"
+            edition = "2015"
+            authors = []
+            license = "MIT"
+            description = "main"
+            repository = "bar"
+
+            [dependencies]
+        "#,
+        )
+        .file("crates/foo.rs/src/lib.rs", "pub fn foo() {}")
+        .file(
+            "crates/bar.rs/Cargo.toml",
+            r#"
+            [package]
+            name = "bar"
+            version = "0.16.2"
+            edition = "2015"
+            authors = []
+            license = "MIT"
+            description = "main"
+            repository = "bar"
+
+            [dependencies]
+            foo = { path = "../foo.rs", version = "0.16.2" }
+        "#,
+        )
+        .file("crates/bar.rs/src/lib.rs", "pub fn foo() {}")
+        .build();
+
+    p.cargo("package -Zpackage-workspace")
+        .masquerade_as_nightly_cargo(&["package-workspace"])
+        .replace_crates_io(reg.index_url())
+        .with_stderr_data(
+            str![[r#"
+[PACKAGING] foo v0.16.2 ([ROOT]/foo/crates/foo.rs)
+[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
+[PACKAGING] bar v0.16.2 ([ROOT]/foo/crates/bar.rs)
+[UPDATING] crates.io index
+[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
+[VERIFYING] foo v0.16.2 ([ROOT]/foo/crates/foo.rs)
+[COMPILING] foo v0.16.2 ([ROOT]/foo/target/package/foo-0.16.2)
+[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
+[VERIFYING] bar v0.16.2 ([ROOT]/foo/crates/bar.rs)
+[UNPACKING] foo v0.16.2 (registry `[ROOT]/foo/target/package/tmp-registry`)
+[COMPILING] foo v0.16.2
+[COMPILING] bar v0.16.2 ([ROOT]/foo/target/package/bar-0.16.2)
+[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
+
+"#]]
+            .unordered(),
+        )
+        .run();
+}
+
 #[cargo_test]
 fn registry_not_in_publish_list() {
     let p = project()
diff --git a/tests/testsuite/script.rs b/tests/testsuite/script.rs
index 5c6a46bb271..20fa7bcb3fb 100644
--- a/tests/testsuite/script.rs
+++ b/tests/testsuite/script.rs
@@ -1358,7 +1358,7 @@ fn cmd_check_with_missing_script_rs() {
         .with_status(101)
         .with_stdout_data("")
         .with_stderr_data(str![[r#"
-[ERROR] manifest path `script.rs` does not exist
+[ERROR] the manifest-path must be a path to a Cargo.toml file
 
 "#]])
         .run();