Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit ef4b974

Browse files
committed
Move proc-macro-test test path fetching from include to env var
1 parent d8a74a2 commit ef4b974

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/tools/rust-analyzer/crates/proc-macro-srv/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Determine rustc version `proc-macro-srv` (and thus the sysroot ABI) is
22
//! build with and make it accessible at runtime for ABI selection.
33
4-
use std::{env, fs::File, io::Write, path::PathBuf, process::Command};
4+
use std::{env, process::Command};
55

66
fn main() {
77
println!("cargo::rustc-check-cfg=cfg(rust_analyzer)");

src/tools/rust-analyzer/crates/proc-macro-srv/proc-macro-test/build.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,5 @@ fn main() {
121121
// This file is under `target_dir` and is already under `OUT_DIR`.
122122
let artifact_path = artifact_path.expect("no dylib for proc-macro-test-impl found");
123123

124-
let info_path = out_dir.join("proc_macro_test_location.txt");
125-
fs::write(info_path, artifact_path.to_str().unwrap()).unwrap();
124+
println!("cargo::rustc-env=PROC_MACRO_TEST_LOCATION={}", artifact_path.display());
126125
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
//! Exports a few trivial procedural macros for testing.
22
3-
pub static PROC_MACRO_TEST_LOCATION: &str =
4-
include_str!(concat!(env!("OUT_DIR"), "/proc_macro_test_location.txt"));
3+
pub static PROC_MACRO_TEST_LOCATION: &str = env!("PROC_MACRO_TEST_LOCATION");

0 commit comments

Comments
 (0)