diff --git a/Cargo.lock b/Cargo.lock index 7a74abffa7d..1f3a30c493a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -89,13 +89,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cargo" version = "0.33.0" -source = "git+https://github.com/rust-lang/cargo?rev=b3d0b2e545b61d4cd08096911724b7d49d213f73#b3d0b2e545b61d4cd08096911724b7d49d213f73" +source = "git+https://github.com/rust-lang/cargo?rev=5e85ba14aaa20f8133863373404cb0af69eeef2c#5e85ba14aaa20f8133863373404cb0af69eeef2c" dependencies = [ "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "bytesize 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "crates-io 0.21.0 (git+https://github.com/rust-lang/cargo?rev=b3d0b2e545b61d4cd08096911724b7d49d213f73)", + "crates-io 0.21.0 (git+https://github.com/rust-lang/cargo?rev=5e85ba14aaa20f8133863373404cb0af69eeef2c)", "crossbeam-utils 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "crypto-hash 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "curl 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", @@ -112,6 +112,7 @@ dependencies = [ "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "home 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "ignore 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "im-rc 12.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "jobserver 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -238,7 +239,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "crates-io" version = "0.21.0" -source = "git+https://github.com/rust-lang/cargo?rev=b3d0b2e545b61d4cd08096911724b7d49d213f73#b3d0b2e545b61d4cd08096911724b7d49d213f73" +source = "git+https://github.com/rust-lang/cargo?rev=5e85ba14aaa20f8133863373404cb0af69eeef2c#5e85ba14aaa20f8133863373404cb0af69eeef2c" dependencies = [ "curl 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -654,6 +655,15 @@ dependencies = [ "winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "im-rc" +version = "12.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "itertools" version = "0.7.9" @@ -1136,7 +1146,7 @@ dependencies = [ name = "rls" version = "1.31.6" dependencies = [ - "cargo 0.33.0 (git+https://github.com/rust-lang/cargo?rev=b3d0b2e545b61d4cd08096911724b7d49d213f73)", + "cargo 0.33.0 (git+https://github.com/rust-lang/cargo?rev=5e85ba14aaa20f8133863373404cb0af69eeef2c)", "cargo_metadata 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "clippy_lints 0.0.212 (git+https://github.com/rust-lang/rust-clippy?rev=754b4c07233ee18820265bd18467aa82263f9a3a)", "crossbeam-channel 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1643,6 +1653,11 @@ dependencies = [ "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "typenum" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "ucd-util" version = "0.1.3" @@ -1797,7 +1812,7 @@ dependencies = [ "checksum bytecount 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f861d9ce359f56dbcb6e0c2a1cb84e52ad732cadb57b806adeb3c7668caccbd8" "checksum byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "94f88df23a25417badc922ab0f5716cc1330e87f71ddd9203b3a3ccd9cedf75d" "checksum bytesize 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "716960a18f978640f25101b5cbf1c6f6b0d3192fab36a2d98ca96f0ecbe41010" -"checksum cargo 0.33.0 (git+https://github.com/rust-lang/cargo?rev=b3d0b2e545b61d4cd08096911724b7d49d213f73)" = "" +"checksum cargo 0.33.0 (git+https://github.com/rust-lang/cargo?rev=5e85ba14aaa20f8133863373404cb0af69eeef2c)" = "" "checksum cargo_metadata 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7d8dfe3adeb30f7938e6c1dd5327f29235d8ada3e898aeb08c343005ec2915a2" "checksum cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "f159dfd43363c4d08055a07703eb7a3406b0dac4d0584d96965a3262db3c9d16" "checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4" @@ -1808,7 +1823,7 @@ dependencies = [ "checksum commoncrypto-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1fed34f46747aa73dfaa578069fd8279d2818ade2b55f38f22a9401c7f4083e2" "checksum core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4e2640d6d0bf22e82bed1b73c6aef8d5dd31e5abe6666c57e6d45e2649f4f887" "checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" -"checksum crates-io 0.21.0 (git+https://github.com/rust-lang/cargo?rev=b3d0b2e545b61d4cd08096911724b7d49d213f73)" = "" +"checksum crates-io 0.21.0 (git+https://github.com/rust-lang/cargo?rev=5e85ba14aaa20f8133863373404cb0af69eeef2c)" = "" "checksum crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb" "checksum crossbeam-channel 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7b85741761b7f160bc5e7e0c14986ef685b7f8bf9b7ad081c60c604bb4649827" "checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3" @@ -1853,6 +1868,7 @@ dependencies = [ "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum if_chain 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4bac95d9aa0624e7b78187d6fb8ab012b41d9f6f54b1bcb61e61c4845f8357ec" "checksum ignore 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "36ecfc5ad80f0b1226df948c562e2cddd446096be3f644c95106400eae8a5e01" +"checksum im-rc 12.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4591152fd573cf453a890b5f9fdc5c328a751a0785539316739d5f85e5c468c" "checksum itertools 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "7cef527957675adbb9ec77a7e3c44c69d729dc0a80e64fe7d380138ef851af1d" "checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" "checksum jobserver 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "60af5f849e1981434e4a31d3d782c4774ae9b434ce55b101a96ecfd09147e8be" @@ -1961,6 +1977,7 @@ dependencies = [ "checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" "checksum toml 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "19782e145d5abefb03758958f06ea35f7b1d8421b534140e0238fd3d0bfd66e3" +"checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" "checksum ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" "checksum unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "6a0180bc61fc5a987082bfa111f4cc95c4caff7f9799f3e46df09163a937aa25" diff --git a/Cargo.toml b/Cargo.toml index 974b7fda0be..0aabdeda437 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ categories = ["development-tools"] build = "build.rs" [dependencies] -cargo = { git = "https://github.com/rust-lang/cargo", rev = "b3d0b2e545b61d4cd08096911724b7d49d213f73" } +cargo = { git = "https://github.com/rust-lang/cargo", rev = "5e85ba14aaa20f8133863373404cb0af69eeef2c" } cargo_metadata = "0.6" clippy_lints = { git = "https://github.com/rust-lang/rust-clippy", rev = "754b4c07233ee18820265bd18467aa82263f9a3a", optional = true } env_logger = "0.5" diff --git a/src/build/cargo.rs b/src/build/cargo.rs index 9ad5e8abf3d..f2840b84d67 100644 --- a/src/build/cargo.rs +++ b/src/build/cargo.rs @@ -376,8 +376,8 @@ impl RlsExecutor { /// Returns whether a given package is a primary one (every member of the /// workspace is considered as such). Used to determine whether the RLS /// should cache invocations for these packages and rebuild them on changes. - fn is_primary_package(&self, id: &PackageId) -> bool { - id.source_id().is_path() || self.member_packages.lock().unwrap().contains(id) + fn is_primary_package(&self, id: PackageId) -> bool { + id.source_id().is_path() || self.member_packages.lock().unwrap().contains(&id) } } @@ -413,7 +413,7 @@ impl Executor for RlsExecutor { fn exec( &self, mut cargo_cmd: ProcessBuilder, - id: &PackageId, + id: PackageId, target: &Target, mode: CompileMode, ) -> CargoResult<()> { @@ -840,7 +840,7 @@ impl ManifestAwareError { if let Some(member) = resolve_err .package_path() .iter() - .filter_map(|pkg| ws.members().find(|m| m.package_id() == pkg)) + .filter_map(|pkg| ws.members().find(|m| m.package_id() == *pkg)) .next() { err_path = member.manifest_path(); diff --git a/src/build/cargo_plan.rs b/src/build/cargo_plan.rs index 245a33e932e..0ac2599ef55 100644 --- a/src/build/cargo_plan.rs +++ b/src/build/cargo_plan.rs @@ -96,18 +96,18 @@ impl CargoPlan { /// cached build plan. crate fn cache_compiler_job( &mut self, - id: &PackageId, + id: PackageId, target: &Target, mode: CompileMode, cmd: &ProcessBuilder, ) { - let unit_key = (id.clone(), target.clone(), mode); + let unit_key = (id, target.clone(), mode); self.compiler_jobs.insert(unit_key, cmd.clone()); } crate fn cache_input_files( &mut self, - id: &PackageId, + id: PackageId, target: &Target, mode: CompileMode, input_files: Vec, diff --git a/src/project_model.rs b/src/project_model.rs index 1771fd53a89..f787daeedc9 100644 --- a/src/project_model.rs +++ b/src/project_model.rs @@ -65,7 +65,7 @@ impl ProjectModel { let mut registry = PackageRegistry::new(ws.config())?; let resolve = resolve_with_prev(&mut registry, &ws, prev.as_ref())?; let cargo_packages = { - let ids: Vec = resolve.iter().cloned().collect(); + let ids: Vec = resolve.iter().collect(); registry.get(&ids)? }; let mut pkg_id_to_pkg = HashMap::new(); @@ -73,7 +73,7 @@ impl ProjectModel { let mut packages = Vec::new(); for (idx, pkg_id) in resolve.iter().enumerate() { let pkg = Package(idx); - pkg_id_to_pkg.insert(pkg_id.clone(), pkg); + pkg_id_to_pkg.insert(pkg_id, pkg); let cargo_pkg = cargo_packages.get_one(pkg_id)?; let manifest = cargo_pkg.manifest_path().to_owned(); packages.push(PackageData { @@ -92,14 +92,14 @@ impl ProjectModel { manifest_to_id.insert(manifest, pkg); } for pkg_id in resolve.iter() { - for (dep_id, _) in resolve.deps(&pkg_id) { + for (dep_id, _) in resolve.deps(pkg_id) { let pkg = cargo_packages.get_one(dep_id)?; let lib = pkg.targets().iter().find(|t| t.is_lib()); if let Some(lib) = lib { - let crate_name = resolve.extern_crate_name(&pkg_id, &dep_id, &lib)?; - packages[pkg_id_to_pkg[pkg_id].0].deps.push(Dep { + let crate_name = resolve.extern_crate_name(pkg_id, dep_id, &lib)?; + packages[pkg_id_to_pkg[&pkg_id].0].deps.push(Dep { crate_name, - pkg: pkg_id_to_pkg[dep_id], + pkg: pkg_id_to_pkg[&dep_id], }) } }