From fe75c6032587e57e7ff127ebaa7d87e20ff6d15c Mon Sep 17 00:00:00 2001 From: Fan Jiang Date: Tue, 10 Mar 2020 18:20:52 -0400 Subject: [PATCH] Fix warnings on latest rustc --- src/base/conversion.rs | 4 ++-- src/base/default_allocator.rs | 2 +- src/base/dimension.rs | 1 - src/base/storage.rs | 3 --- tests/core/matrix.rs | 3 --- tests/linalg/inverse.rs | 2 +- 6 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/base/conversion.rs b/src/base/conversion.rs index e52a0c5d..cf68b024 100644 --- a/src/base/conversion.rs +++ b/src/base/conversion.rs @@ -119,7 +119,7 @@ macro_rules! impl_from_into_asref_1D( #[inline] fn into(self) -> [N; $SZ] { unsafe { - let mut res: [N; $SZ] = mem::uninitialized(); + let mut res: [N; $SZ] = mem::MaybeUninit::uninit().assume_init(); ptr::copy_nonoverlapping(self.data.ptr(), &mut res[0], $SZ); res @@ -186,7 +186,7 @@ macro_rules! impl_from_into_asref_2D( #[inline] fn into(self) -> [[N; $SZRows]; $SZCols] { unsafe { - let mut res: [[N; $SZRows]; $SZCols] = mem::uninitialized(); + let mut res: [[N; $SZRows]; $SZCols] = mem::MaybeUninit::uninit().assume_init(); ptr::copy_nonoverlapping(self.data.ptr(), &mut res[0][0], $SZRows * $SZCols); res diff --git a/src/base/default_allocator.rs b/src/base/default_allocator.rs index c07c8708..a15b0b7c 100644 --- a/src/base/default_allocator.rs +++ b/src/base/default_allocator.rs @@ -46,7 +46,7 @@ where #[inline] unsafe fn allocate_uninitialized(_: R, _: C) -> Self::Buffer { - mem::uninitialized() + mem::MaybeUninit::uninit().assume_init() } #[inline] diff --git a/src/base/dimension.rs b/src/base/dimension.rs index 112996d3..e7150e65 100644 --- a/src/base/dimension.rs +++ b/src/base/dimension.rs @@ -190,7 +190,6 @@ pub trait DimName: Dim { type Value: NamedDim; /// The name of this dimension, i.e., the singleton `Self`. - #[inline] fn name() -> Self; // FIXME: this is not a very idiomatic name. diff --git a/src/base/storage.rs b/src/base/storage.rs index e7439552..8e472e1e 100644 --- a/src/base/storage.rs +++ b/src/base/storage.rs @@ -94,13 +94,11 @@ pub unsafe trait Storage: Debug + Sized { } /// Indicates whether this data buffer stores its elements contiguously. - #[inline] fn is_contiguous(&self) -> bool; /// Retrieves the data buffer as a contiguous slice. /// /// The matrix components may not be stored in a contiguous way, depending on the strides. - #[inline] fn as_slice(&self) -> &[N]; /// Builds a matrix data storage that does not contain any reference. @@ -166,7 +164,6 @@ pub unsafe trait StorageMut: Storage { /// Retrieves the mutable data buffer as a contiguous slice. /// /// Matrix components may not be contiguous, depending on its strides. - #[inline] fn as_mut_slice(&mut self) -> &mut [N]; } diff --git a/tests/core/matrix.rs b/tests/core/matrix.rs index 6fad5e8c..4f61ce6e 100644 --- a/tests/core/matrix.rs +++ b/tests/core/matrix.rs @@ -7,9 +7,6 @@ use na::{ Matrix4x3, Matrix4x5, Matrix5, Matrix6, MatrixMN, RowVector3, RowVector4, RowVector5, Vector1, Vector2, Vector3, Vector4, Vector5, Vector6, }; -use typenum::{UInt, UTerm}; -use serde_json::error::Category::Data; -use typenum::bit::{B0, B1}; #[test] fn iter() { diff --git a/tests/linalg/inverse.rs b/tests/linalg/inverse.rs index 61f43324..f0be4dd7 100644 --- a/tests/linalg/inverse.rs +++ b/tests/linalg/inverse.rs @@ -130,7 +130,7 @@ fn matrix5_try_inverse_scaled_identity() { 0.0, 1.0e+20, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0e+20, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0e+20, 0.0, - 0.0, 0.0, 0.0, 0.0, 1.0e+20);; + 0.0, 0.0, 0.0, 0.0, 1.0e+20); let a_inv = a.try_inverse().expect("Matrix should be invertible"); assert_relative_eq!(a_inv, expected_inverse);