Skip to content

Commit 193955e

Browse files
authored
Produce clear error message when build runs with conflicting features (#11895)
Throw explicit error message when `cargo build` is invoked with conflicting features, e.g. `cargo test --lib --tests --bins --all-features`.
1 parent 786f353 commit 193955e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

benchmarks/src/bin/dfbench.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ use datafusion::error::Result;
2020

2121
use structopt::StructOpt;
2222

23+
#[cfg(all(feature = "snmalloc", feature = "mimalloc"))]
24+
compile_error!(
25+
"feature \"snmalloc\" and feature \"mimalloc\" cannot be enabled at the same time"
26+
);
27+
2328
#[cfg(feature = "snmalloc")]
2429
#[global_allocator]
2530
static ALLOC: snmalloc_rs::SnMalloc = snmalloc_rs::SnMalloc;

benchmarks/src/bin/tpch.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ use datafusion::error::Result;
2121
use datafusion_benchmarks::tpch;
2222
use structopt::StructOpt;
2323

24+
#[cfg(all(feature = "snmalloc", feature = "mimalloc"))]
25+
compile_error!(
26+
"feature \"snmalloc\" and feature \"mimalloc\" cannot be enabled at the same time"
27+
);
28+
2429
#[cfg(feature = "snmalloc")]
2530
#[global_allocator]
2631
static ALLOC: snmalloc_rs::SnMalloc = snmalloc_rs::SnMalloc;

0 commit comments

Comments
 (0)