diff --git a/Cargo.lock b/Cargo.lock index e690985f8a..2fcf55a905 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "adler" version = "0.2.3" @@ -150,8 +152,8 @@ checksum = "81a18687293a1546b67c246452202bbbf143d239cb43494cc163da14979082da" [[package]] name = "cargo" -version = "0.52.0" -source = "git+https://github.com/rust-lang/cargo?rev=34170fcd6e0947808a1ac63ac85ffc0da7dace2f#34170fcd6e0947808a1ac63ac85ffc0da7dace2f" +version = "0.53.0" +source = "git+https://github.com/rust-lang/cargo?rev=970bc67c3775781b9708c8a36893576b9459c64a#970bc67c3775781b9708c8a36893576b9459c64a" dependencies = [ "anyhow", "atty", @@ -187,6 +189,7 @@ dependencies = [ "num_cpus", "opener", "percent-encoding 2.1.0", + "rand 0.8.3", "rustc-workspace-hack", "rustfix", "same-file", @@ -210,7 +213,7 @@ dependencies = [ [[package]] name = "cargo-platform" version = "0.1.1" -source = "git+https://github.com/rust-lang/cargo?rev=34170fcd6e0947808a1ac63ac85ffc0da7dace2f#34170fcd6e0947808a1ac63ac85ffc0da7dace2f" +source = "git+https://github.com/rust-lang/cargo?rev=970bc67c3775781b9708c8a36893576b9459c64a#970bc67c3775781b9708c8a36893576b9459c64a" dependencies = [ "serde", ] @@ -372,7 +375,7 @@ checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" [[package]] name = "crates-io" version = "0.33.0" -source = "git+https://github.com/rust-lang/cargo?rev=34170fcd6e0947808a1ac63ac85ffc0da7dace2f#34170fcd6e0947808a1ac63ac85ffc0da7dace2f" +source = "git+https://github.com/rust-lang/cargo?rev=970bc67c3775781b9708c8a36893576b9459c64a#970bc67c3775781b9708c8a36893576b9459c64a" dependencies = [ "anyhow", "curl", diff --git a/Cargo.toml b/Cargo.toml index c816a5b680..996485e6d6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/rls/src/build/cargo.rs b/rls/src/build/cargo.rs index 6e9929adc0..d2aa9a3c86 100644 --- a/rls/src/build/cargo.rs +++ b/rls/src/build/cargo.rs @@ -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, @@ -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))?; diff --git a/rls/src/project_model.rs b/rls/src/project_model.rs index edac0e5f94..4b5fae5cef 100644 --- a/rls/src/project_model.rs +++ b/rls/src/project_model.rs @@ -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)?;