@@ -13,6 +13,7 @@ use cargo_platform::Platform;
13
13
use cargo_util:: paths;
14
14
use cargo_util_schemas:: manifest:: {
15
15
self , PackageName , PathBaseName , TomlDependency , TomlDetailedDependency , TomlManifest ,
16
+ TomlWorkspace ,
16
17
} ;
17
18
use cargo_util_schemas:: manifest:: { RustVersion , StringOrBool } ;
18
19
use itertools:: Itertools ;
@@ -80,7 +81,8 @@ pub fn read_manifest(
80
81
let empty = Vec :: new ( ) ;
81
82
let cargo_features = original_toml. cargo_features . as_ref ( ) . unwrap_or ( & empty) ;
82
83
let features = Features :: new ( cargo_features, gctx, & mut warnings, source_id. is_path ( ) ) ?;
83
- let workspace_config = to_workspace_config ( & original_toml, path, gctx, & mut warnings) ?;
84
+ let workspace_config =
85
+ to_workspace_config ( & original_toml, path, is_embedded, gctx, & mut warnings) ?;
84
86
if let WorkspaceConfig :: Root ( ws_root_config) = & workspace_config {
85
87
let package_root = path. parent ( ) . unwrap ( ) ;
86
88
gctx. ws_roots
@@ -211,9 +213,14 @@ fn stringify(dst: &mut String, path: &serde_ignored::Path<'_>) {
211
213
fn to_workspace_config (
212
214
original_toml : & manifest:: TomlManifest ,
213
215
manifest_file : & Path ,
216
+ is_embedded : bool ,
214
217
gctx : & GlobalContext ,
215
218
warnings : & mut Vec < String > ,
216
219
) -> CargoResult < WorkspaceConfig > {
220
+ if is_embedded {
221
+ let ws_root_config = to_workspace_root_config ( & TomlWorkspace :: default ( ) , manifest_file) ;
222
+ return Ok ( WorkspaceConfig :: Root ( ws_root_config) ) ;
223
+ }
217
224
let workspace_config = match (
218
225
original_toml. workspace . as_ref ( ) ,
219
226
original_toml. package ( ) . and_then ( |p| p. workspace . as_ref ( ) ) ,
0 commit comments