diff --git a/src/cargo/core/workspace.rs b/src/cargo/core/workspace.rs index a81c6b9304e..55db0e913a8 100644 --- a/src/cargo/core/workspace.rs +++ b/src/cargo/core/workspace.rs @@ -1800,7 +1800,10 @@ impl<'gctx> Packages<'gctx> { match self.packages.entry(key.to_path_buf()) { Entry::Occupied(e) => Ok(e.into_mut()), Entry::Vacant(v) => { - let source_id = SourceId::for_path(key)?; + let source_id = match crate::util::toml::is_embedded(manifest_path) { + true => SourceId::for_path(manifest_path)?, + false => SourceId::for_path(key)?, + }; let manifest = read_manifest(manifest_path, source_id, self.gctx)?; Ok(v.insert(match manifest { EitherManifest::Real(manifest) => {