@@ -17,7 +17,7 @@ use cargo::core::{
1717} ;
1818use cargo:: ops:: { compile_with_exec, CompileFilter , CompileOptions , Packages } ;
1919use cargo:: util:: {
20- errors:: ManifestError , homedir, important_paths, CargoResult , Config as CargoConfig ,
20+ config as cargo_config , errors:: ManifestError , homedir, important_paths, CargoResult ,
2121 ConfigValue , ProcessBuilder ,
2222} ;
2323use failure:: { self , format_err, Fail } ;
@@ -166,7 +166,7 @@ fn run_cargo_ws(
166166 inner_lock : environment:: InnerLock ,
167167 mut restore_env : Environment < ' _ > ,
168168 manifest_path : & PathBuf ,
169- config : & CargoConfig ,
169+ config : & cargo_config :: Config ,
170170 ws : & Workspace < ' _ > ,
171171) -> CargoResult < PathBuf > {
172172 let ( all, packages) = match package_arg {
@@ -649,8 +649,8 @@ pub fn make_cargo_config(
649649 target_dir : Option < & Path > ,
650650 cwd : & Path ,
651651 shell : Shell ,
652- ) -> CargoConfig {
653- let config = CargoConfig :: new ( shell, cwd. to_path_buf ( ) , homedir ( build_dir) . unwrap ( ) ) ;
652+ ) -> cargo_config :: Config {
653+ let config = cargo_config :: Config :: new ( shell, cwd. to_path_buf ( ) , homedir ( build_dir) . unwrap ( ) ) ;
654654
655655 // Cargo is expecting the config to come from a config file and keeps
656656 // track of the path to that file. We'll make one up, it shouldn't be
@@ -662,9 +662,10 @@ pub fn make_cargo_config(
662662
663663 let mut config_value_map = config. load_values ( ) . unwrap ( ) ;
664664 {
665- let build_value = config_value_map
666- . entry ( "build" . to_owned ( ) )
667- . or_insert_with ( || ConfigValue :: Table ( HashMap :: new ( ) , config_path. clone ( ) ) ) ;
665+ let build_value = config_value_map. entry ( "build" . to_owned ( ) ) . or_insert_with ( || {
666+ let def = cargo_config:: Definition :: Path ( config_path. clone ( ) ) ;
667+ ConfigValue :: Table ( HashMap :: new ( ) , def)
668+ } ) ;
668669
669670 let target_dir = target_dir. map ( |d| d. to_str ( ) . unwrap ( ) . to_owned ( ) ) . unwrap_or_else ( || {
670671 // Try to use .cargo/config build.target-dir + "/rls"
@@ -686,7 +687,8 @@ pub fn make_cargo_config(
686687 cargo_target. join ( "rls" ) . to_str ( ) . unwrap ( ) . to_owned ( )
687688 } ) ;
688689
689- let td_value = ConfigValue :: String ( target_dir, config_path) ;
690+ let def = cargo_config:: Definition :: Path ( config_path) ;
691+ let td_value = ConfigValue :: String ( target_dir, def) ;
690692 if let ConfigValue :: Table ( ref mut build_table, _) = * build_value {
691693 build_table. insert ( "target-dir" . to_owned ( ) , td_value) ;
692694 } else {
0 commit comments