diff --git a/src/font/system.rs b/src/font/system.rs index 7d7e786..299bb99 100644 --- a/src/font/system.rs +++ b/src/font/system.rs @@ -7,10 +7,10 @@ use core::ops::{Deref, DerefMut}; type BuildHasher = core::hash::BuildHasherDefault; -#[cfg(feature = "no_std")] -type HashMap = hashbrown::HashMap; -#[cfg(not(feature = "no_std"))] +#[cfg(feature = "std")] type HashMap = std::collections::HashMap; +#[cfg(not(feature = "std"))] +type HashMap = hashbrown::HashMap; // re-export fontdb and rustybuzz pub use fontdb; diff --git a/src/lib.rs b/src/lib.rs index 3a16321..ac684b9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -91,9 +91,11 @@ // Ensure numbers are readable #![warn(clippy::unreadable_literal)] #![cfg_attr(not(feature = "std"), no_std)] - extern crate alloc; +#[cfg(not(any(feature = "std", feature = "no_std")))] +compile_error!("Either the `std` or `no_std` feature must be enabled"); + pub use self::attrs::*; mod attrs;