@@ -447,7 +447,7 @@ impl<'gctx> Workspace<'gctx> {
447447 BTreeMap < String , BTreeMap < String , TomlDependency < ConfigRelativePath > > > ,
448448 > = self . gctx . get ( "patch" ) ?;
449449
450- let source = SourceId :: for_path ( self . root ( ) ) ?;
450+ let source = SourceId :: for_manifest_path ( self . root_manifest ( ) ) ?;
451451
452452 let mut warnings = Vec :: new ( ) ;
453453
@@ -1144,7 +1144,7 @@ impl<'gctx> Workspace<'gctx> {
11441144 if let Some ( p) = loaded. get ( manifest_path) . cloned ( ) {
11451145 return Ok ( p) ;
11461146 }
1147- let source_id = SourceId :: for_path ( manifest_path. parent ( ) . unwrap ( ) ) ?;
1147+ let source_id = SourceId :: for_manifest_path ( manifest_path) ?;
11481148 let package = ops:: read_package ( manifest_path, source_id, self . gctx ) ?;
11491149 loaded. insert ( manifest_path. to_path_buf ( ) , package. clone ( ) ) ;
11501150 Ok ( package)
@@ -1975,8 +1975,7 @@ pub fn find_workspace_root(
19751975 gctx : & GlobalContext ,
19761976) -> CargoResult < Option < PathBuf > > {
19771977 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) ?;
19801979 let manifest = read_manifest ( self_path, source_id, gctx) ?;
19811980 Ok ( manifest
19821981 . workspace_config ( )
0 commit comments