summaryrefslogtreecommitdiffstats
path: root/src/tools/rust-analyzer/crates/proc-macro-test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
commita4b7ed7a42c716ab9f05e351f003d589124fd55d (patch)
treeb620cd3f223850b28716e474e80c58059dca5dd4 /src/tools/rust-analyzer/crates/proc-macro-test
parentAdding upstream version 1.67.1+dfsg1. (diff)
downloadrustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz
rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/rust-analyzer/crates/proc-macro-test')
-rw-r--r--src/tools/rust-analyzer/crates/proc-macro-test/build.rs17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/tools/rust-analyzer/crates/proc-macro-test/build.rs b/src/tools/rust-analyzer/crates/proc-macro-test/build.rs
index a80c96261..19a5caa4c 100644
--- a/src/tools/rust-analyzer/crates/proc-macro-test/build.rs
+++ b/src/tools/rust-analyzer/crates/proc-macro-test/build.rs
@@ -63,7 +63,7 @@ fn main() {
};
cmd.current_dir(&staging_dir)
- .args(&["build", "-p", "proc-macro-test-impl", "--message-format", "json"])
+ .args(["build", "-p", "proc-macro-test-impl", "--message-format", "json"])
// Explicit override the target directory to avoid using the same one which the parent
// cargo is using, or we'll deadlock.
// This can happen when `CARGO_TARGET_DIR` is set or global config forces all cargo
@@ -71,7 +71,7 @@ fn main() {
.arg("--target-dir")
.arg(&target_dir);
- println!("Running {:?}", cmd);
+ println!("Running {cmd:?}");
let output = cmd.output().unwrap();
if !output.status.success() {
@@ -85,16 +85,13 @@ fn main() {
let mut artifact_path = None;
for message in Message::parse_stream(output.stdout.as_slice()) {
- match message.unwrap() {
- Message::CompilerArtifact(artifact) => {
- if artifact.target.kind.contains(&"proc-macro".to_string()) {
- let repr = format!("{} {}", name, version);
- if artifact.package_id.repr.starts_with(&repr) {
- artifact_path = Some(PathBuf::from(&artifact.filenames[0]));
- }
+ if let Message::CompilerArtifact(artifact) = message.unwrap() {
+ if artifact.target.kind.contains(&"proc-macro".to_string()) {
+ let repr = format!("{name} {version}");
+ if artifact.package_id.repr.starts_with(&repr) {
+ artifact_path = Some(PathBuf::from(&artifact.filenames[0]));
}
}
- _ => (), // Unknown message
}
}