@@ -312,7 +312,7 @@ fn normalize_toml(
312312 inherit_cell
313313 . try_borrow_with ( || load_inheritable_fields ( gctx, manifest_file, & workspace_config) )
314314 } ;
315- let workspace_root = || inherit ( ) . map ( |fields| fields. ws_root ( ) ) ;
315+ let workspace_root = || inherit ( ) . map ( |fields| fields. ws_root ( ) . as_path ( ) ) ;
316316
317317 if let Some ( original_package) = original_toml. package ( ) {
318318 let package_name = & original_package. name ;
@@ -538,7 +538,7 @@ fn normalize_toml(
538538fn normalize_patch < ' a > (
539539 gctx : & GlobalContext ,
540540 original_patch : Option < & BTreeMap < String , BTreeMap < PackageName , TomlDependency > > > ,
541- workspace_root : & dyn Fn ( ) -> CargoResult < & ' a PathBuf > ,
541+ workspace_root : & dyn Fn ( ) -> CargoResult < & ' a Path > ,
542542 features : & Features ,
543543) -> CargoResult < Option < BTreeMap < String , BTreeMap < PackageName , TomlDependency > > > > {
544544 if let Some ( patch) = original_patch {
@@ -757,7 +757,7 @@ fn normalize_dependencies<'a>(
757757 activated_opt_deps : & HashSet < & str > ,
758758 kind : Option < DepKind > ,
759759 inherit : & dyn Fn ( ) -> CargoResult < & ' a InheritableFields > ,
760- workspace_root : & dyn Fn ( ) -> CargoResult < & ' a PathBuf > ,
760+ workspace_root : & dyn Fn ( ) -> CargoResult < & ' a Path > ,
761761 package_root : & Path ,
762762 warnings : & mut Vec < String > ,
763763) -> CargoResult < Option < BTreeMap < manifest:: PackageName , manifest:: InheritableDependency > > > {
@@ -839,7 +839,7 @@ fn normalize_dependencies<'a>(
839839fn normalize_path_dependency < ' a > (
840840 gctx : & GlobalContext ,
841841 detailed_dep : & mut TomlDetailedDependency ,
842- workspace_root : & dyn Fn ( ) -> CargoResult < & ' a PathBuf > ,
842+ workspace_root : & dyn Fn ( ) -> CargoResult < & ' a Path > ,
843843 features : & Features ,
844844) -> CargoResult < ( ) > {
845845 if let Some ( base) = detailed_dep. base . take ( ) {
@@ -2225,7 +2225,7 @@ fn to_dependency_source_id<P: ResolveToPath + Clone>(
22252225pub ( crate ) fn lookup_path_base < ' a > (
22262226 base : & PathBaseName ,
22272227 gctx : & GlobalContext ,
2228- workspace_root : & dyn Fn ( ) -> CargoResult < & ' a PathBuf > ,
2228+ workspace_root : & dyn Fn ( ) -> CargoResult < & ' a Path > ,
22292229 features : & Features ,
22302230) -> CargoResult < PathBuf > {
22312231 features. require ( Feature :: path_bases ( ) ) ?;
@@ -2240,7 +2240,7 @@ pub(crate) fn lookup_path_base<'a>(
22402240 } else {
22412241 // Otherwise, check the built-in bases.
22422242 match base. as_str ( ) {
2243- "workspace" => Ok ( workspace_root ( ) ?. clone ( ) ) ,
2243+ "workspace" => Ok ( workspace_root ( ) ?. to_path_buf ( ) ) ,
22442244 _ => bail ! (
22452245 "path base `{base}` is undefined. \
22462246 You must add an entry for `{base}` in the Cargo configuration [path-bases] table."
0 commit comments