From eaa28848e3f952f15512d74507fc5c61ee7345af Mon Sep 17 00:00:00 2001 From: Colerar <233hbj@gmail.com> Date: Sat, 29 Apr 2023 19:03:24 +0800 Subject: [PATCH 1/2] Improve error message for non-SIMD scenarios --- src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index e0a892aa..57416625 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -225,7 +225,8 @@ use simdutf8::basic::imp::x86::sse42::ChunkedUtf8ValidatorImp; target_feature = "simd128" )) ))] -fn please_compile_with_a_simd_compatible_cpu_setting_read_the_simdjsonrs_readme() -> ! {} +const _: () = + compile_error!("Please compile with a simd compatible cpu setting, read the simdjson README."); mod stage2; /// simd-json JSON-DOM value From dfec304ee51046bbffbd4a118757f409ac4c3fa8 Mon Sep 17 00:00:00 2001 From: Colerar <233hbj@gmail.com> Date: Tue, 2 May 2023 16:01:43 +0800 Subject: [PATCH 2/2] Specify `rustdocflags` in `.cargo/config` --- .cargo/config | 1 + 1 file changed, 1 insertion(+) diff --git a/.cargo/config b/.cargo/config index cca906b5..0fb556e7 100644 --- a/.cargo/config +++ b/.cargo/config @@ -1,5 +1,6 @@ [build] rustflags = ["-C", "target-cpu=native"] +rustdocflags = ["-C", "target-cpu=native"] [target.wasm32-unknown-unknown] rustflags = ["-C", "target-feature=+simd128"]