Skip to content

Commit

Permalink
fix: correct test for mutually exclusive feature flags (#1085)
Browse files Browse the repository at this point in the history
* fix: correct feature flag names when testing mutual exclusivity

* chore: remove default feature from `nargo`

* chore: revert removal of default feature flag
  • Loading branch information
TomAFrench authored Apr 3, 2023
1 parent 57c817f commit eb5c917
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions crates/nargo/src/backends.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);

0 comments on commit eb5c917

Please sign in to comment.