Skip to content

Commit 3e453ed

Browse files
committed
emit compile error when none of std and hashbrown is enabled
1 parent 694b6ff commit 3e453ed

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/allocator/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ use crate::result::*;
1010
pub(crate) mod dedicated_block_allocator;
1111
pub(crate) use dedicated_block_allocator::DedicatedBlockAllocator;
1212

13-
#[cfg(any(feature = "std", feature = "hashbrown"))]
1413
pub(crate) mod free_list_allocator;
15-
#[cfg(any(feature = "std", feature = "hashbrown"))]
1614
pub(crate) use free_list_allocator::FreeListAllocator;
1715

1816
#[derive(PartialEq, Copy, Clone, Debug)]

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ extern crate alloc;
225225
#[cfg(all(not(feature = "std"), feature = "visualizer"))]
226226
compile_error!("Cannot enable \"visualizer\" feature in \"no_std\" environment.");
227227

228+
#[cfg(not(any(feature = "std", feature = "hashbrown")))]
229+
compile_error!("Either `std` or `hashbrown` feature must be enabled");
230+
228231
mod result;
229232
pub use result::*;
230233

0 commit comments

Comments
 (0)