From 5e0ad400aa319251401c034e82e27f8f427dafba Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sun, 19 Apr 2020 15:35:48 -0700 Subject: [PATCH] Update cargo --- Cargo.lock | 37 +++++++++++++------------------------ Cargo.toml | 2 +- rls/src/build/cargo.rs | 8 ++++---- rls/src/build/cargo_plan.rs | 20 ++++++++++---------- 4 files changed, 28 insertions(+), 39 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7c49c89895b..9058571b29e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -203,8 +203,8 @@ dependencies = [ [[package]] name = "cargo" -version = "0.44.0" -source = "git+https://github.com/rust-lang/cargo?rev=bda50510d1daf6e9c53ad6ccf603da6e0fa8103f#bda50510d1daf6e9c53ad6ccf603da6e0fa8103f" +version = "0.45.0" +source = "git+https://github.com/rust-lang/cargo?rev=5b620dc044e8999e6bc0193f9e037c4618519547#5b620dc044e8999e6bc0193f9e037c4618519547" dependencies = [ "anyhow", "atty", @@ -213,7 +213,6 @@ dependencies = [ "clap", "core-foundation", "crates-io", - "crossbeam-channel", "crossbeam-utils 0.7.0", "crypto-hash", "curl", @@ -221,7 +220,6 @@ dependencies = [ "env_logger 0.7.1", "filetime", "flate2", - "fs2", "fwdansi", "git2", "git2-curl", @@ -257,6 +255,7 @@ dependencies = [ "termcolor", "toml", "unicode-width", + "unicode-xid", "url 2.1.0", "walkdir", "winapi 0.3.8", @@ -265,7 +264,7 @@ dependencies = [ [[package]] name = "cargo-platform" version = "0.1.1" -source = "git+https://github.com/rust-lang/cargo?rev=bda50510d1daf6e9c53ad6ccf603da6e0fa8103f#bda50510d1daf6e9c53ad6ccf603da6e0fa8103f" +source = "git+https://github.com/rust-lang/cargo?rev=5b620dc044e8999e6bc0193f9e037c4618519547#5b620dc044e8999e6bc0193f9e037c4618519547" dependencies = [ "serde", ] @@ -397,7 +396,7 @@ checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" [[package]] name = "crates-io" version = "0.31.0" -source = "git+https://github.com/rust-lang/cargo?rev=bda50510d1daf6e9c53ad6ccf603da6e0fa8103f#bda50510d1daf6e9c53ad6ccf603da6e0fa8103f" +source = "git+https://github.com/rust-lang/cargo?rev=5b620dc044e8999e6bc0193f9e037c4618519547#5b620dc044e8999e6bc0193f9e037c4618519547" dependencies = [ "anyhow", "curl", @@ -669,9 +668,9 @@ checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" [[package]] name = "filetime" -version = "0.2.7" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bd7380b54ced79dda72ecc35cc4fbbd1da6bba54afaa37e96fd1c2a308cd469" +checksum = "f59efc38004c988e4201d11d263b8171f49a2e7ec0bdbb71773433f271504a5e" dependencies = [ "cfg-if", "libc", @@ -713,16 +712,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" -[[package]] -name = "fs2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" -dependencies = [ - "libc", - "winapi 0.3.8", -] - [[package]] name = "fst" version = "0.3.5" @@ -795,9 +784,9 @@ dependencies = [ [[package]] name = "git2" -version = "0.12.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26e07ef27260a78f7e8d218ebac2c72f2c4db50493741b190b6e8eade1da7c68" +checksum = "2cfb93ca10f2934069c3aaafb753fbe0663f08ee009a01b6d62e062391447b15" dependencies = [ "bitflags", "libc", @@ -810,9 +799,9 @@ dependencies = [ [[package]] name = "git2-curl" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1754ec4170e7dcaf9bb43743bb16eddb8d827b2e0291deb6f220a6e16fe46a" +checksum = "502d532a2d06184beb3bc869d4d90236e60934e3382c921b203fa3c33e212bd7" dependencies = [ "curl", "git2", @@ -1125,9 +1114,9 @@ checksum = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558" [[package]] name = "libgit2-sys" -version = "0.11.0+0.99.0" +version = "0.12.3+1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d5d1459353d397a029fb18862166338de938e6be976606bd056cf8f1a912ecf" +checksum = "7637dc15e7f05a16011723e0448655081fc01a374bcd368e2c9b9c7f5c5ab3ea" dependencies = [ "cc", "libc", diff --git a/Cargo.toml b/Cargo.toml index 7f9fa030465..8f41b2bc3df 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 = "bda50510d1daf6e9c53ad6ccf603da6e0fa8103f" } +cargo = { git = "https://github.com/rust-lang/cargo", rev = "5b620dc044e8999e6bc0193f9e037c4618519547" } cargo_metadata = "0.8" clippy_lints = { git = "https://github.com/rust-lang/rust-clippy", rev = "d236b30a1d638340aad8345fa2946cfe9543dcf0", optional = true } env_logger = "0.7" diff --git a/rls/src/build/cargo.rs b/rls/src/build/cargo.rs index 0af2870a0f4..0cf24faba44 100644 --- a/rls/src/build/cargo.rs +++ b/rls/src/build/cargo.rs @@ -356,19 +356,19 @@ impl Executor for RlsExecutor { /// unit of work (may still be modified for runtime-known dependencies, when /// the work is actually executed). This is called even for a target that /// is fresh and won't be compiled. - fn init<'a>(&self, cx: &Context<'a, '_>, unit: &Unit<'a>) { + fn init<'a>(&self, cx: &Context<'a, '_>, unit: &Unit) { let mut compilation_cx = self.compilation_cx.lock().unwrap(); let plan = compilation_cx .build_plan .as_cargo_mut() .expect("build plan should be properly initialized before running Cargo"); - let only_primary = |unit: Unit<'_>| self.is_primary_package(unit.pkg.package_id()); + let only_primary = |unit: &Unit| self.is_primary_package(unit.pkg.package_id()); - plan.emplace_dep_with_filter(*unit, cx, &only_primary); + plan.emplace_dep_with_filter(unit, cx, &only_primary); } - fn force_rebuild(&self, unit: &Unit<'_>) -> bool { + fn force_rebuild(&self, unit: &Unit) -> bool { // We need to force rebuild every package in the // workspace, even if it's not dirty at a time, to cache compiler // invocations in the build plan. diff --git a/rls/src/build/cargo_plan.rs b/rls/src/build/cargo_plan.rs index 2e2d53c7bd2..edc989c0de8 100644 --- a/rls/src/build/cargo_plan.rs +++ b/rls/src/build/cargo_plan.rs @@ -127,11 +127,11 @@ impl CargoPlan { /// out by the `filter` closure. pub(crate) fn emplace_dep_with_filter<'a, Filter>( &mut self, - unit: Unit<'a>, + unit: &Unit, cx: &Context<'a, '_>, filter: &Filter, ) where - Filter: Fn(Unit<'a>) -> bool, + Filter: Fn(&Unit) -> bool, { if !filter(unit) { return; @@ -150,13 +150,13 @@ impl CargoPlan { self.units.insert(key.clone(), unit.into()); // Fetch and insert relevant unit dependencies to the forward dep graph. - let deps = cx.unit_deps(&unit); + let deps = cx.unit_deps(unit); let dep_keys: HashSet = deps .iter() - .map(|dep| dep.unit) + .map(|dep| &dep.unit) // We might not want certain deps to be added transitively (e.g. // when creating only a sub-dep-graph, limiting the scope). - .filter(|unit| filter(*unit)) + .filter(|unit| filter(unit)) .map(UnitKey::from) // Units can depend on others with different Targets or Profiles // (e.g. different `run_custom_build`) despite having the same UnitKey. @@ -175,7 +175,7 @@ impl CargoPlan { // Recursively process other remaining forward dependencies. for dep in deps { - self.emplace_dep_with_filter(dep.unit, cx, filter); + self.emplace_dep_with_filter(&dep.unit, cx, filter); } } @@ -464,8 +464,8 @@ impl PackageMap { } } -impl From> for UnitKey { - fn from(unit: Unit<'_>) -> UnitKey { +impl From<&Unit> for UnitKey { + fn from(unit: &Unit) -> UnitKey { UnitKey { pkg_id: unit.pkg.package_id(), target: unit.target.clone(), mode: unit.mode } } } @@ -480,8 +480,8 @@ pub(crate) struct OwnedUnit { pub(crate) mode: CompileMode, } -impl From> for OwnedUnit { - fn from(unit: Unit<'_>) -> OwnedUnit { +impl From<&Unit> for OwnedUnit { + fn from(unit: &Unit) -> OwnedUnit { OwnedUnit { id: unit.pkg.package_id().to_owned(), target: unit.target.clone(),