From 3888fbe51fb599437b168ded1f19d7adc6d83423 Mon Sep 17 00:00:00 2001 From: Henno Date: Mon, 23 Nov 2020 01:37:47 -0500 Subject: [PATCH] Add compile error when both use-compiled-tools and use-installed-tools are enabled (#269) * Add compile error when both use-compiled-tools and use-installed-tools are enabled The compile error is located in the build.rs for rustc-codegen-spirv so that the error happens early, rather than after compiling spirv-tools. * lint * lint --- crates/rustc_codegen_spirv/build.rs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 crates/rustc_codegen_spirv/build.rs diff --git a/crates/rustc_codegen_spirv/build.rs b/crates/rustc_codegen_spirv/build.rs new file mode 100644 index 0000000000..14d3a9efad --- /dev/null +++ b/crates/rustc_codegen_spirv/build.rs @@ -0,0 +1,8 @@ +// Putting this check here causes compilation failure seconds into the build, +// putting it in lib.rs fails after minutes because spirv-tools gets compiled first. +#[cfg(all(feature = "use-compiled-tools", feature = "use-installed-tools"))] +compile_error!( + "Either \"use-compiled-tools\" (enabled by default) or \"use-installed-tools\" may be enabled." +); + +fn main() {}