From dec68197011959f5423bd004158a5a61385dcff5 Mon Sep 17 00:00:00 2001 From: Ciprian Dorin Craciun Date: Sat, 19 May 2018 23:49:13 +0300 Subject: [PATCH] Gracefully fail if `use_std` is not used Use `compile_error!` macro to issue a meaningful compile error if the `use_std` feature is not enabled. --- src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 9f3577fffc..559cb51ef0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -521,6 +521,11 @@ another matching engine with fixed memory requirements. #![cfg_attr(test, deny(warnings))] #![cfg_attr(feature = "pattern", feature(pattern))] + +#[cfg(not(feature = "use_std"))] +compile_error!("`use_std` feature is currently required to build this crate"); + + extern crate aho_corasick; extern crate memchr; extern crate thread_local;