We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1514c7e commit 183eeffCopy full SHA for 183eeff
src/cargo/sources/path.rs
@@ -124,6 +124,9 @@ impl<'gctx> PathSource<'gctx> {
124
}
125
126
fn read_package(&self) -> CargoResult<Package> {
127
+ if crate::util::toml::is_embedded(&self.path) {
128
+ anyhow::bail!("The embedded script cannot be used as a dependency");
129
+ }
130
let path = self.path.join("Cargo.toml");
131
let pkg = ops::read_package(&path, self.source_id, self.gctx)?;
132
Ok(pkg)
tests/testsuite/script.rs
@@ -1402,10 +1402,7 @@ Caused by:
1402
Unable to update [ROOT]/foo/script.rs
1403
1404
Caused by:
1405
- failed to read `[ROOT]/foo/script.rs/Cargo.toml`
1406
-
1407
-Caused by:
1408
- Not a directory (os error 20)
+ The embedded script cannot be used as a dependency
1409
1410
"#]])
1411
.run();
0 commit comments