@@ -447,7 +447,7 @@ impl<'gctx> Workspace<'gctx> {
447
447
BTreeMap < String , BTreeMap < String , TomlDependency < ConfigRelativePath > > > ,
448
448
> = self . gctx . get ( "patch" ) ?;
449
449
450
- let source = SourceId :: for_path ( self . root ( ) ) ?;
450
+ let source = SourceId :: for_manifest_path ( self . root_manifest ( ) ) ?;
451
451
452
452
let mut warnings = Vec :: new ( ) ;
453
453
@@ -1144,7 +1144,7 @@ impl<'gctx> Workspace<'gctx> {
1144
1144
if let Some ( p) = loaded. get ( manifest_path) . cloned ( ) {
1145
1145
return Ok ( p) ;
1146
1146
}
1147
- let source_id = SourceId :: for_path ( manifest_path. parent ( ) . unwrap ( ) ) ?;
1147
+ let source_id = SourceId :: for_manifest_path ( manifest_path) ?;
1148
1148
let package = ops:: read_package ( manifest_path, source_id, self . gctx ) ?;
1149
1149
loaded. insert ( manifest_path. to_path_buf ( ) , package. clone ( ) ) ;
1150
1150
Ok ( package)
@@ -1975,8 +1975,7 @@ pub fn find_workspace_root(
1975
1975
gctx : & GlobalContext ,
1976
1976
) -> CargoResult < Option < PathBuf > > {
1977
1977
find_workspace_root_with_loader ( manifest_path, gctx, |self_path| {
1978
- let key = self_path. parent ( ) . unwrap ( ) ;
1979
- let source_id = SourceId :: for_path ( key) ?;
1978
+ let source_id = SourceId :: for_manifest_path ( self_path) ?;
1980
1979
let manifest = read_manifest ( self_path, source_id, gctx) ?;
1981
1980
Ok ( manifest
1982
1981
. workspace_config ( )
0 commit comments