From eb5c917e4e5550229fd1fd174b9fd7e507058d25 Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Mon, 3 Apr 2023 19:14:17 +0100 Subject: [PATCH] fix: correct test for mutually exclusive feature flags (#1085) * fix: correct feature flag names when testing mutual exclusivity * chore: remove default feature from `nargo` * chore: revert removal of default feature flag --- crates/nargo/src/backends.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/crates/nargo/src/backends.rs b/crates/nargo/src/backends.rs index 85e94edda82..ea5aec4c576 100644 --- a/crates/nargo/src/backends.rs +++ b/crates/nargo/src/backends.rs @@ -10,6 +10,17 @@ cfg_if::cfg_if! { compile_error!("please specify a backend to compile with"); } } -// XXX: This works because there are only two features, we want to say only one of these can be enabled. (feature xor) -#[cfg(all(feature = "plonk", feature = "marlin"))] -compile_error!("feature \"plonk\" and feature \"marlin\" cannot be enabled at the same time"); + +// As we have 3 feature flags we must test all 3 potential pairings to ensure they're mutually exclusive. +#[cfg(all(feature = "plonk_bn254", feature = "plonk_bn254_wasm"))] +compile_error!( + "feature \"plonk_bn254\" and feature \"plonk_bn254_wasm\" cannot be enabled at the same time" +); +#[cfg(all(feature = "plonk_bn254_wasm", feature = "marlin"))] +compile_error!( + "feature \"plonk_bn254_wasm\" and feature \"marlin\" cannot be enabled at the same time" +); +#[cfg(all(feature = "plonk_bn254", feature = "marlin"))] +compile_error!( + "feature \"plonk_bn254\" and feature \"marlin\" cannot be enabled at the same time" +);