@@ -17,7 +17,7 @@ use cargo::core::{
17
17
} ;
18
18
use cargo:: ops:: { compile_with_exec, CompileFilter , CompileOptions , Packages } ;
19
19
use cargo:: util:: {
20
- errors:: ManifestError , homedir, important_paths, CargoResult , Config as CargoConfig ,
20
+ config as cargo_config , errors:: ManifestError , homedir, important_paths, CargoResult ,
21
21
ConfigValue , ProcessBuilder ,
22
22
} ;
23
23
use failure:: { self , format_err, Fail } ;
@@ -166,7 +166,7 @@ fn run_cargo_ws(
166
166
inner_lock : environment:: InnerLock ,
167
167
mut restore_env : Environment < ' _ > ,
168
168
manifest_path : & PathBuf ,
169
- config : & CargoConfig ,
169
+ config : & cargo_config :: Config ,
170
170
ws : & Workspace < ' _ > ,
171
171
) -> CargoResult < PathBuf > {
172
172
let ( all, packages) = match package_arg {
@@ -649,8 +649,8 @@ pub fn make_cargo_config(
649
649
target_dir : Option < & Path > ,
650
650
cwd : & Path ,
651
651
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 ( ) ) ;
654
654
655
655
// Cargo is expecting the config to come from a config file and keeps
656
656
// 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(
662
662
663
663
let mut config_value_map = config. load_values ( ) . unwrap ( ) ;
664
664
{
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
+ } ) ;
668
669
669
670
let target_dir = target_dir. map ( |d| d. to_str ( ) . unwrap ( ) . to_owned ( ) ) . unwrap_or_else ( || {
670
671
// Try to use .cargo/config build.target-dir + "/rls"
@@ -686,7 +687,8 @@ pub fn make_cargo_config(
686
687
cargo_target. join ( "rls" ) . to_str ( ) . unwrap ( ) . to_owned ( )
687
688
} ) ;
688
689
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) ;
690
692
if let ConfigValue :: Table ( ref mut build_table, _) = * build_value {
691
693
build_table. insert ( "target-dir" . to_owned ( ) , td_value) ;
692
694
} else {
0 commit comments