From db43b44f71818df4d6cc100969d21a65d3ce2645 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 14 Jan 2019 16:15:25 +0300 Subject: update cargo_metadata --- crates/ra_lsp_server/Cargo.toml | 2 +- crates/ra_lsp_server/src/project_model/cargo_workspace.rs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'crates') 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" lsp-types = "0.54.0" walkdir = "2.2.7" im = "12.0.0" -cargo_metadata = "0.6.0" +cargo_metadata = "0.7.0" rustc-hash = "1.0" parking_lot = "0.7.0" 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 @@ use std::path::{Path, PathBuf}; -use cargo_metadata::{metadata_run, CargoOpt}; +use cargo_metadata::{MetadataCommand, CargoOpt}; use ra_syntax::SmolStr; use ra_arena::{Arena, RawId, impl_arena_id}; use rustc_hash::FxHashMap; @@ -117,7 +117,10 @@ impl Target { impl CargoWorkspace { pub fn from_cargo_metadata(cargo_toml: &Path) -> Result { - let meta = metadata_run(Some(cargo_toml), true, Some(CargoOpt::AllFeatures)) + let meta = MetadataCommand::new() + .manifest_path(cargo_toml) + .features(CargoOpt::AllFeatures) + .exec() .map_err(|e| format_err!("cargo metadata failed: {}", e))?; let mut pkg_by_id = FxHashMap::default(); let mut packages = Arena::default(); -- cgit v1.2.3