Skip to content

Commit

Permalink
Fix proc-macro-test-impl building without any proc-macros
Browse files Browse the repository at this point in the history
  • Loading branch information
Veykril committed Dec 21, 2023
1 parent 9197b54 commit ca957f4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
5 changes: 0 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions crates/proc-macro-srv/proc-macro-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
3 changes: 3 additions & 0 deletions crates/proc-macro-srv/proc-macro-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
2 changes: 1 addition & 1 deletion crates/proc-macro-srv/src/proc_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)> {
Expand Down

0 comments on commit ca957f4

Please sign in to comment.