Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit d8d0951

Browse files
committed
Update cargo.
1 parent fed7a31 commit d8d0951

File tree

4 files changed

+48
-42
lines changed

4 files changed

+48
-42
lines changed

Cargo.lock

+36-32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ rls-span = "0.5"
2929
rls-vfs = "0.8"
3030
rls-ipc = { version = "0.1.0", path = "rls-ipc", optional = true }
3131

32-
cargo = { git = "https://github.com/rust-lang/cargo", rev = "626f0f40efd32e6b3dbade50cd53fdfaa08446ba" }
32+
cargo = { git = "https://github.com/rust-lang/cargo", rev = "86134e7666a088682f20b76278c3ee096a315218" }
3333
cargo_metadata = "0.8"
3434
clippy_lints = { git = "https://github.com/rust-lang/rust-clippy", rev = "b245fbd0f2bdbd002611a45d0758f9be44eaf66b", optional = true }
3535
env_logger = "0.7"

rls/src/build/cargo.rs

+10-8
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use cargo::core::{
1717
};
1818
use cargo::ops::{compile_with_exec, CompileFilter, CompileOptions, Packages};
1919
use 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
};
2323
use 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 {

rls/src/project_model.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl ProjectModel {
4848
// Enable nightly flag for cargo(see #1043)
4949
cargo::core::enable_nightly_features();
5050
// frozen = false, locked = false, offline = false
51-
config.configure(0, Some(true), &None, false, false, false, &None, &[])?;
51+
config.configure(0, Some(true), None, false, false, false, &None, &[], &[])?;
5252
let ws = Workspace::new(&ws_manifest, &config)?;
5353
// get resolve from lock file
5454
let prev = {

0 commit comments

Comments
 (0)