mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
4406: Update cargo-metadata r=matklad a=edwin0cheng This PR update `cargo-metadata` to 0.10.0 and it also relax the` serde-derive` deps to 1.0 for tests in `proc-macro-srv`. cc @robojumper r= @matklad , I think you would have something to say related to https://github.com/serde-rs/json/issues/647#issue-593788429 ? 4410: Improve wording in comment r=matklad a=edwin0cheng 4411: do not remove then block when you unwrap else block #4361 r=matklad a=bnjjj close #4361 4417: Omit default types in HirDisplay SourceCode mode r=matklad a=TimoFreiberg Closes #4390 Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com> Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com> Co-authored-by: Timo Freiberg <timo.freiberg@gmail.com>
This commit is contained in:
commit
a3dbd272e0
14 changed files with 285 additions and 97 deletions
|
@ -161,7 +161,7 @@ impl CargoWorkspace {
|
|||
meta.current_dir(parent);
|
||||
}
|
||||
if let Some(target) = cargo_features.target.as_ref() {
|
||||
meta.other_options(&[String::from("--filter-platform"), target.clone()]);
|
||||
meta.other_options(vec![String::from("--filter-platform"), target.clone()]);
|
||||
}
|
||||
let meta = meta.exec().with_context(|| {
|
||||
format!("Failed to run `cargo metadata --manifest-path {}`", cargo_toml.display())
|
||||
|
@ -304,19 +304,13 @@ pub fn load_extern_resources(
|
|||
|
||||
let mut res = ExternResources::default();
|
||||
|
||||
for message in cargo_metadata::parse_messages(output.stdout.as_slice()) {
|
||||
for message in cargo_metadata::Message::parse_stream(output.stdout.as_slice()) {
|
||||
if let Ok(message) = message {
|
||||
match message {
|
||||
Message::BuildScriptExecuted(BuildScript { package_id, out_dir, cfgs, .. }) => {
|
||||
res.out_dirs.insert(package_id.clone(), out_dir);
|
||||
res.cfgs.insert(
|
||||
package_id,
|
||||
// FIXME: Current `cargo_metadata` uses `PathBuf` instead of `String`,
|
||||
// change when https://github.com/oli-obk/cargo_metadata/pulls/112 reaches crates.io
|
||||
cfgs.iter().filter_map(|c| c.to_str().map(|s| s.to_owned())).collect(),
|
||||
);
|
||||
res.cfgs.insert(package_id, cfgs);
|
||||
}
|
||||
|
||||
Message::CompilerArtifact(message) => {
|
||||
if message.target.kind.contains(&"proc-macro".to_string()) {
|
||||
let package_id = message.package_id;
|
||||
|
@ -329,6 +323,8 @@ pub fn load_extern_resources(
|
|||
}
|
||||
Message::CompilerMessage(_) => (),
|
||||
Message::Unknown => (),
|
||||
Message::BuildFinished(_) => {}
|
||||
Message::TextLine(_) => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue