aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack O'Connor <[email protected]>2023-10-02 08:36:29 -0700
committerJack O'Connor <[email protected]>2023-10-02 08:36:29 -0700
commit3d921ae703a492d7449228d29990c8bc9e768c40 (patch)
tree50df5a9f6c24e25cb3d44732be6d1dc64bdde3ab
parent5aa53f07f7188a569cadfc5daf1522972d9a9630 (diff)
allow(unreachable_code) in all the *_detected functions
Previously we only disabled these warnings for SSE2, which is assumed enabled on x86-64, but it looks like new nightly compilers are also assuming SSE4.1 on macOS. Disabling these warnings across all the detection functions accounts for that, and it also gets rid of some warnings that you'd see if you used RUSTFLAGS='-C target-cpu=native'.
-rw-r--r--src/platform.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/platform.rs b/src/platform.rs
index 00058b1..ef910aa 100644
--- a/src/platform.rs
+++ b/src/platform.rs
@@ -327,6 +327,7 @@ impl Platform {
#[cfg(blake3_avx512_ffi)]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[inline(always)]
+#[allow(unreachable_code)]
pub fn avx512_detected() -> bool {
// A testing-only short-circuit.
if cfg!(feature = "no_avx512") {
@@ -349,6 +350,7 @@ pub fn avx512_detected() -> bool {
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[inline(always)]
+#[allow(unreachable_code)]
pub fn avx2_detected() -> bool {
// A testing-only short-circuit.
if cfg!(feature = "no_avx2") {
@@ -371,6 +373,7 @@ pub fn avx2_detected() -> bool {
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[inline(always)]
+#[allow(unreachable_code)]
pub fn sse41_detected() -> bool {
// A testing-only short-circuit.
if cfg!(feature = "no_sse41") {