From ba34025abccc94077e8c0e33370b27b76051993c Mon Sep 17 00:00:00 2001 From: Zack Owens Date: Mon, 24 Apr 2023 09:00:16 -0700 Subject: [PATCH] Remove warnings from build --- build.rs | 9 +++++---- src/lib.rs | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build.rs b/build.rs index c206df3..1fcb1ec 100644 --- a/build.rs +++ b/build.rs @@ -3,14 +3,15 @@ extern crate rustc_version; use rustc_version::{version_meta, Channel}; use std::path::Path; -use std::{io, mem, ops}; +use std::{io, ops}; /// CRC-32-Castagnoli polynomial in reversed bit order. pub const POLYNOMIAL: u32 = 0x82_F6_3B_78; /// Table for a quadword-at-a-time software CRC. fn sw_table() -> [[u32; 256]; 8] { - let mut table: [[u32; 256]; 8] = unsafe { mem::MaybeUninit::uninit().assume_init() }; + let mut table: [[u32; 256]; 8] = [[0u32; 256]; 8]; + for n in 0..256 { let mut crc = n; @@ -45,7 +46,7 @@ pub struct Matrix([u32; 32]); impl Matrix { /// Allocates space for a new matrix. fn new() -> Self { - unsafe { mem::MaybeUninit::uninit().assume_init() } + Matrix([0u32; 32]) } /// Multiplies a matrix by itself. @@ -132,7 +133,7 @@ fn create_zero_operator(mut len: usize) -> Matrix { } fn hw_table(len: usize) -> [[u32; 256]; 4] { - let mut zeroes: [[u32; 256]; 4] = unsafe { mem::MaybeUninit::uninit().assume_init() }; + let mut zeroes: [[u32; 256]; 4] = [[0u32; 256]; 4]; let op = create_zero_operator(len); for n in 0..256 { diff --git a/src/lib.rs b/src/lib.rs index f8ae620..12a48fc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,7 +20,7 @@ //! Otherwise, the crate will use `cpuid` at runtime to detect the //! running CPU's features, and enable the appropiate algorithm. -#![cfg_attr(nightly, feature(stdsimd, aarch64_target_feature))] +#![cfg_attr(nightly, feature(stdsimd))] mod combine; #[cfg(all(target_arch = "aarch64", nightly))]