diff options
Diffstat (limited to 'crates/ra_project_model/src')
-rw-r--r-- | crates/ra_project_model/src/cargo_workspace.rs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/crates/ra_project_model/src/cargo_workspace.rs b/crates/ra_project_model/src/cargo_workspace.rs index 082af4f96..a306ce95f 100644 --- a/crates/ra_project_model/src/cargo_workspace.rs +++ b/crates/ra_project_model/src/cargo_workspace.rs | |||
@@ -161,7 +161,7 @@ impl CargoWorkspace { | |||
161 | meta.current_dir(parent); | 161 | meta.current_dir(parent); |
162 | } | 162 | } |
163 | if let Some(target) = cargo_features.target.as_ref() { | 163 | if let Some(target) = cargo_features.target.as_ref() { |
164 | meta.other_options(&[String::from("--filter-platform"), target.clone()]); | 164 | meta.other_options(vec![String::from("--filter-platform"), target.clone()]); |
165 | } | 165 | } |
166 | let meta = meta.exec().with_context(|| { | 166 | let meta = meta.exec().with_context(|| { |
167 | format!("Failed to run `cargo metadata --manifest-path {}`", cargo_toml.display()) | 167 | format!("Failed to run `cargo metadata --manifest-path {}`", cargo_toml.display()) |
@@ -304,19 +304,13 @@ pub fn load_extern_resources( | |||
304 | 304 | ||
305 | let mut res = ExternResources::default(); | 305 | let mut res = ExternResources::default(); |
306 | 306 | ||
307 | for message in cargo_metadata::parse_messages(output.stdout.as_slice()) { | 307 | for message in cargo_metadata::Message::parse_stream(output.stdout.as_slice()) { |
308 | if let Ok(message) = message { | 308 | if let Ok(message) = message { |
309 | match message { | 309 | match message { |
310 | Message::BuildScriptExecuted(BuildScript { package_id, out_dir, cfgs, .. }) => { | 310 | Message::BuildScriptExecuted(BuildScript { package_id, out_dir, cfgs, .. }) => { |
311 | res.out_dirs.insert(package_id.clone(), out_dir); | 311 | res.out_dirs.insert(package_id.clone(), out_dir); |
312 | res.cfgs.insert( | 312 | res.cfgs.insert(package_id, cfgs); |
313 | package_id, | ||
314 | // FIXME: Current `cargo_metadata` uses `PathBuf` instead of `String`, | ||
315 | // change when https://github.com/oli-obk/cargo_metadata/pulls/112 reaches crates.io | ||
316 | cfgs.iter().filter_map(|c| c.to_str().map(|s| s.to_owned())).collect(), | ||
317 | ); | ||
318 | } | 313 | } |
319 | |||
320 | Message::CompilerArtifact(message) => { | 314 | Message::CompilerArtifact(message) => { |
321 | if message.target.kind.contains(&"proc-macro".to_string()) { | 315 | if message.target.kind.contains(&"proc-macro".to_string()) { |
322 | let package_id = message.package_id; | 316 | let package_id = message.package_id; |
@@ -329,6 +323,8 @@ pub fn load_extern_resources( | |||
329 | } | 323 | } |
330 | Message::CompilerMessage(_) => (), | 324 | Message::CompilerMessage(_) => (), |
331 | Message::Unknown => (), | 325 | Message::Unknown => (), |
326 | Message::BuildFinished(_) => {} | ||
327 | Message::TextLine(_) => {} | ||
332 | } | 328 | } |
333 | } | 329 | } |
334 | } | 330 | } |