Skip to content

Commit 8f853b0

Browse files
committed
add no_std feature compile error
1 parent fbc57a3 commit 8f853b0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,16 @@
212212
//! # fn main() {}
213213
//! ```
214214
#![deny(clippy::unimplemented, clippy::unwrap_used, clippy::ok_expect)]
215+
#![cfg_attr(not(feature = "std"), no_std)]
216+
217+
#[macro_use]
218+
extern crate alloc;
219+
220+
#[cfg(all(not(feature = "std"), not(feature = "hashbrown")))]
221+
compile_error!("\"hashbrown\" feature should be enabled in \"no_std\" environment.");
222+
223+
#[cfg(all(not(feature = "std"), feature = "visualizer"))]
224+
compile_error!("Cannot enable \"visualizer\" feature in \"no_std\" environment.");
215225

216226
mod result;
217227
pub use result::*;

0 commit comments

Comments
 (0)