@@ -312,7 +312,7 @@ fn normalize_toml(
312
312
inherit_cell
313
313
. try_borrow_with ( || load_inheritable_fields ( gctx, manifest_file, & workspace_config) )
314
314
} ;
315
- let workspace_root = || inherit ( ) . map ( |fields| fields. ws_root ( ) ) ;
315
+ let workspace_root = || inherit ( ) . map ( |fields| fields. ws_root ( ) . as_path ( ) ) ;
316
316
317
317
if let Some ( original_package) = original_toml. package ( ) {
318
318
let package_name = & original_package. name ;
@@ -538,7 +538,7 @@ fn normalize_toml(
538
538
fn normalize_patch < ' a > (
539
539
gctx : & GlobalContext ,
540
540
original_patch : Option < & BTreeMap < String , BTreeMap < PackageName , TomlDependency > > > ,
541
- workspace_root : & dyn Fn ( ) -> CargoResult < & ' a PathBuf > ,
541
+ workspace_root : & dyn Fn ( ) -> CargoResult < & ' a Path > ,
542
542
features : & Features ,
543
543
) -> CargoResult < Option < BTreeMap < String , BTreeMap < PackageName , TomlDependency > > > > {
544
544
if let Some ( patch) = original_patch {
@@ -757,7 +757,7 @@ fn normalize_dependencies<'a>(
757
757
activated_opt_deps : & HashSet < & str > ,
758
758
kind : Option < DepKind > ,
759
759
inherit : & dyn Fn ( ) -> CargoResult < & ' a InheritableFields > ,
760
- workspace_root : & dyn Fn ( ) -> CargoResult < & ' a PathBuf > ,
760
+ workspace_root : & dyn Fn ( ) -> CargoResult < & ' a Path > ,
761
761
package_root : & Path ,
762
762
warnings : & mut Vec < String > ,
763
763
) -> CargoResult < Option < BTreeMap < manifest:: PackageName , manifest:: InheritableDependency > > > {
@@ -839,7 +839,7 @@ fn normalize_dependencies<'a>(
839
839
fn normalize_path_dependency < ' a > (
840
840
gctx : & GlobalContext ,
841
841
detailed_dep : & mut TomlDetailedDependency ,
842
- workspace_root : & dyn Fn ( ) -> CargoResult < & ' a PathBuf > ,
842
+ workspace_root : & dyn Fn ( ) -> CargoResult < & ' a Path > ,
843
843
features : & Features ,
844
844
) -> CargoResult < ( ) > {
845
845
if let Some ( base) = detailed_dep. base . take ( ) {
@@ -2225,7 +2225,7 @@ fn to_dependency_source_id<P: ResolveToPath + Clone>(
2225
2225
pub ( crate ) fn lookup_path_base < ' a > (
2226
2226
base : & PathBaseName ,
2227
2227
gctx : & GlobalContext ,
2228
- workspace_root : & dyn Fn ( ) -> CargoResult < & ' a PathBuf > ,
2228
+ workspace_root : & dyn Fn ( ) -> CargoResult < & ' a Path > ,
2229
2229
features : & Features ,
2230
2230
) -> CargoResult < PathBuf > {
2231
2231
features. require ( Feature :: path_bases ( ) ) ?;
@@ -2240,7 +2240,7 @@ pub(crate) fn lookup_path_base<'a>(
2240
2240
} else {
2241
2241
// Otherwise, check the built-in bases.
2242
2242
match base. as_str ( ) {
2243
- "workspace" => Ok ( workspace_root ( ) ?. clone ( ) ) ,
2243
+ "workspace" => Ok ( workspace_root ( ) ?. to_path_buf ( ) ) ,
2244
2244
_ => bail ! (
2245
2245
"path base `{base}` is undefined. \
2246
2246
You must add an entry for `{base}` in the Cargo configuration [path-bases] table."
0 commit comments