mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
fix: better error message for using the script as a dep
Signed-off-by: Rustin170506 <techregister@pm.me>
This commit is contained in:
parent
1514c7e630
commit
91da8dba0d
@ -393,6 +393,9 @@ impl SourceId {
|
||||
.url
|
||||
.to_file_path()
|
||||
.expect("path sources cannot be remote");
|
||||
if crate::util::toml::is_embedded(&path) {
|
||||
anyhow::bail!("Single file packages cannot be used as dependencies")
|
||||
}
|
||||
Ok(Box::new(PathSource::new(&path, self, gctx)))
|
||||
}
|
||||
SourceKind::Registry | SourceKind::SparseRegistry => Ok(Box::new(
|
||||
|
@ -1402,10 +1402,7 @@ Caused by:
|
||||
Unable to update [ROOT]/foo/script.rs
|
||||
|
||||
Caused by:
|
||||
failed to read `[ROOT]/foo/script.rs/Cargo.toml`
|
||||
|
||||
Caused by:
|
||||
Not a directory (os error 20)
|
||||
Single file packages cannot be used as dependencies
|
||||
|
||||
"#]])
|
||||
.run();
|
||||
|
Loading…
x
Reference in New Issue
Block a user