diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-14 13:16:21 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-14 13:16:21 +0000 |
commit | 784ff638e549a27503b719e5c2f0009b40d25364 (patch) | |
tree | f32f55787771aef45c4a5ab40e5f707904ae1c3d /crates | |
parent | 8caff4e03475c20392f13e8c6ad469bd01a4b4ce (diff) | |
parent | db43b44f71818df4d6cc100969d21a65d3ce2645 (diff) |
Merge #538
538: update cargo_metadata r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_lsp_server/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/project_model/cargo_workspace.rs | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/crates/ra_lsp_server/Cargo.toml b/crates/ra_lsp_server/Cargo.toml index 0557897fd..e87d311eb 100644 --- a/crates/ra_lsp_server/Cargo.toml +++ b/crates/ra_lsp_server/Cargo.toml | |||
@@ -20,7 +20,7 @@ url_serde = "0.2.0" | |||
20 | lsp-types = "0.54.0" | 20 | lsp-types = "0.54.0" |
21 | walkdir = "2.2.7" | 21 | walkdir = "2.2.7" |
22 | im = "12.0.0" | 22 | im = "12.0.0" |
23 | cargo_metadata = "0.6.0" | 23 | cargo_metadata = "0.7.0" |
24 | rustc-hash = "1.0" | 24 | rustc-hash = "1.0" |
25 | parking_lot = "0.7.0" | 25 | parking_lot = "0.7.0" |
26 | 26 | ||
diff --git a/crates/ra_lsp_server/src/project_model/cargo_workspace.rs b/crates/ra_lsp_server/src/project_model/cargo_workspace.rs index 8f7518860..75ae78bca 100644 --- a/crates/ra_lsp_server/src/project_model/cargo_workspace.rs +++ b/crates/ra_lsp_server/src/project_model/cargo_workspace.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use std::path::{Path, PathBuf}; | 1 | use std::path::{Path, PathBuf}; |
2 | 2 | ||
3 | use cargo_metadata::{metadata_run, CargoOpt}; | 3 | use cargo_metadata::{MetadataCommand, CargoOpt}; |
4 | use ra_syntax::SmolStr; | 4 | use ra_syntax::SmolStr; |
5 | use ra_arena::{Arena, RawId, impl_arena_id}; | 5 | use ra_arena::{Arena, RawId, impl_arena_id}; |
6 | use rustc_hash::FxHashMap; | 6 | use rustc_hash::FxHashMap; |
@@ -117,7 +117,10 @@ impl Target { | |||
117 | 117 | ||
118 | impl CargoWorkspace { | 118 | impl CargoWorkspace { |
119 | pub fn from_cargo_metadata(cargo_toml: &Path) -> Result<CargoWorkspace> { | 119 | pub fn from_cargo_metadata(cargo_toml: &Path) -> Result<CargoWorkspace> { |
120 | let meta = metadata_run(Some(cargo_toml), true, Some(CargoOpt::AllFeatures)) | 120 | let meta = MetadataCommand::new() |
121 | .manifest_path(cargo_toml) | ||
122 | .features(CargoOpt::AllFeatures) | ||
123 | .exec() | ||
121 | .map_err(|e| format_err!("cargo metadata failed: {}", e))?; | 124 | .map_err(|e| format_err!("cargo metadata failed: {}", e))?; |
122 | let mut pkg_by_id = FxHashMap::default(); | 125 | let mut pkg_by_id = FxHashMap::default(); |
123 | let mut packages = Arena::default(); | 126 | let mut packages = Arena::default(); |