Skip to content

Commit

Permalink
Produce clear error message when build runs with conflicting features
Browse files Browse the repository at this point in the history
Throw explicit error message when `cargo build` is invoked with
conflicting features, e.g.  `cargo test --lib --tests --bins
--all-features`.
  • Loading branch information
findepi committed Aug 8, 2024
1 parent 0332eb5 commit 9f3ddcd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions benchmarks/src/bin/dfbench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ use datafusion::error::Result;

use structopt::StructOpt;

#[cfg(all(feature = "snmalloc", feature = "mimalloc"))]
compile_error!(
"feature \"snmalloc\" and feature \"mimalloc\" cannot be enabled at the same time"
);

#[cfg(feature = "snmalloc")]
#[global_allocator]
static ALLOC: snmalloc_rs::SnMalloc = snmalloc_rs::SnMalloc;
Expand Down
5 changes: 5 additions & 0 deletions benchmarks/src/bin/tpch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ use datafusion::error::Result;
use datafusion_benchmarks::tpch;
use structopt::StructOpt;

#[cfg(all(feature = "snmalloc", feature = "mimalloc"))]
compile_error!(
"feature \"snmalloc\" and feature \"mimalloc\" cannot be enabled at the same time"
);

#[cfg(feature = "snmalloc")]
#[global_allocator]
static ALLOC: snmalloc_rs::SnMalloc = snmalloc_rs::SnMalloc;
Expand Down

0 comments on commit 9f3ddcd

Please sign in to comment.