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

Commit

Permalink
Update Cargo
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed Mar 9, 2021
1 parent 27064e8 commit fd1df15
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
11 changes: 7 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ rls-vfs = "0.8"
rls-ipc = { version = "0.1.0", path = "rls-ipc", optional = true }

anyhow = "1.0.26"
cargo = { git = "https://github.com/rust-lang/cargo", rev = "34170fcd6e0947808a1ac63ac85ffc0da7dace2f" }
cargo = { git = "https://github.com/rust-lang/cargo", rev = "970bc67c3775781b9708c8a36893576b9459c64a" }
cargo_metadata = "0.8"
clippy_lints = { git = "https://github.com/rust-lang/rust-clippy", rev = "7ea7cd165ad6705603852771bf82cc2fd6560db5", optional = true }
env_logger = "0.7"
Expand Down
8 changes: 3 additions & 5 deletions rls/src/build/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ use std::thread;
use cargo::core::compiler::{BuildConfig, CompileMode, Context, Executor, Unit};
use cargo::core::resolver::ResolveError;
use cargo::core::Package;
use cargo::core::{
enable_nightly_features, PackageId, Shell, Target, TargetKind, Verbosity, Workspace,
};
use cargo::core::{PackageId, Shell, Target, TargetKind, Verbosity, Workspace};
use cargo::ops::{compile_with_exec, CompileFilter, CompileOptions, Packages};
use cargo::util::{
config as cargo_config, errors::ManifestError, homedir, important_paths, CargoResult,
Expand Down Expand Up @@ -123,14 +121,14 @@ fn run_cargo(
let mut shell = Shell::from_write(Box::new(BufWriter(Arc::clone(&out))));
shell.set_verbosity(Verbosity::Quiet);

let config = {
let mut config = {
let rls_config = rls_config.lock().unwrap();

let target_dir = rls_config.target_dir.as_ref().as_ref().map(|p| p as &Path);
make_cargo_config(manifest_dir, target_dir, restore_env.get_old_cwd(), shell)
};
config.nightly_features_allowed = true;

enable_nightly_features();
let ws = Workspace::new(&manifest_path, &config)
.map_err(|err| ManifestAwareError::new(err, &manifest_path, None))?;

Expand Down
2 changes: 1 addition & 1 deletion rls/src/project_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl ProjectModel {
assert!(ws_manifest.ends_with("Cargo.toml"));
let mut config = Config::default()?;
// Enable nightly flag for cargo(see #1043)
cargo::core::enable_nightly_features();
config.nightly_features_allowed = true;
// frozen = false, locked = false, offline = false
config.configure(0, true, None, false, false, false, &None, &[], &[])?;
let ws = Workspace::new(&ws_manifest, &config)?;
Expand Down

0 comments on commit fd1df15

Please sign in to comment.