about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2023-12-15 17:47:47 +0100
committerLukas Wirth <lukastw97@gmail.com>2023-12-21 17:24:00 +0100
commitca957f4f8212b4346942fc3dee0a7e15b7193a07 (patch)
tree2bc92b76b83d4d9da4304029108f0db4d2da87b1
parent9197b541c222e278e350b84b7510ec13f848d5a4 (diff)
downloadrust-ca957f4f8212b4346942fc3dee0a7e15b7193a07.tar.gz
rust-ca957f4f8212b4346942fc3dee0a7e15b7193a07.zip
Fix proc-macro-test-impl building without any proc-macros
-rw-r--r--Cargo.lock5
-rw-r--r--crates/proc-macro-srv/proc-macro-test/Cargo.toml6
-rw-r--r--crates/proc-macro-srv/proc-macro-test/build.rs3
-rw-r--r--crates/proc-macro-srv/src/proc_macros.rs2
4 files changed, 6 insertions, 10 deletions
diff --git a/Cargo.lock b/Cargo.lock
index aeb7444aa30..4616b2fde81 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1304,15 +1304,10 @@ name = "proc-macro-test"
 version = "0.0.0"
 dependencies = [
  "cargo_metadata",
- "proc-macro-test-impl",
  "toolchain",
 ]
 
 [[package]]
-name = "proc-macro-test-impl"
-version = "0.0.0"
-
-[[package]]
 name = "proc-macro2"
 version = "1.0.69"
 source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/crates/proc-macro-srv/proc-macro-test/Cargo.toml b/crates/proc-macro-srv/proc-macro-test/Cargo.toml
index ea8a01b00c7..55be6bc23bb 100644
--- a/crates/proc-macro-srv/proc-macro-test/Cargo.toml
+++ b/crates/proc-macro-srv/proc-macro-test/Cargo.toml
@@ -12,10 +12,8 @@ doctest = false
 [build-dependencies]
 cargo_metadata = "0.18.1"
 
-proc-macro-test-impl = { path = "imp", version = "0.0.0" }
-
 # local deps
-toolchain.path = "../../toolchain"
+toolchain = { path = "../../toolchain", version = "0.0.0" }
 
 [features]
-sysroot-abi = ["proc-macro-test-impl/sysroot-abi"]
+sysroot-abi = []
diff --git a/crates/proc-macro-srv/proc-macro-test/build.rs b/crates/proc-macro-srv/proc-macro-test/build.rs
index 7827157865a..7299147686d 100644
--- a/crates/proc-macro-srv/proc-macro-test/build.rs
+++ b/crates/proc-macro-srv/proc-macro-test/build.rs
@@ -70,6 +70,9 @@ fn main() {
         // instance to use the same target directory.
         .arg("--target-dir")
         .arg(&target_dir);
+    if cfg!(feature = "sysroot-abi") {
+        cmd.args(["--features", "sysroot-abi"]);
+    }
 
     if let Ok(target) = std::env::var("TARGET") {
         cmd.args(["--target", &target]);
diff --git a/crates/proc-macro-srv/src/proc_macros.rs b/crates/proc-macro-srv/src/proc_macros.rs
index a75c0e619bc..3fe968c81ca 100644
--- a/crates/proc-macro-srv/src/proc_macros.rs
+++ b/crates/proc-macro-srv/src/proc_macros.rs
@@ -97,7 +97,7 @@ impl ProcMacros {
             }
         }
 
-        Err(bridge::PanicMessage::String("Nothing to expand".to_string()).into())
+        Err(bridge::PanicMessage::String(format!("proc-macro `{macro_name}` is missing")).into())
     }
 
     pub(crate) fn list_macros(&self) -> Vec<(String, ProcMacroKind)> {