From eb456f18bb89490f6538d383fcdfe87a46ed886b Mon Sep 17 00:00:00 2001 From: Andreas Longva Date: Mon, 14 Nov 2022 10:56:13 +0100 Subject: [PATCH] Move slice deprecation macro to lib.rs This way we can use it across the library, in changes that will follow this commit. --- src/base/alias_slice.rs | 245 +++++++++++++++++++--------------------- src/lib.rs | 13 +++ 2 files changed, 132 insertions(+), 126 deletions(-) diff --git a/src/base/alias_slice.rs b/src/base/alias_slice.rs index f71262d4..d3f8879a 100644 --- a/src/base/alias_slice.rs +++ b/src/base/alias_slice.rs @@ -1,14 +1,7 @@ use crate::base::dimension::{Dynamic, U1, U2, U3, U4, U5, U6}; use crate::base::matrix_view::{ViewStorage, ViewStorageMut}; use crate::base::{Const, Matrix}; - -/// Generates an appropriate deprecation note with a suggestion for replacement. -macro_rules! deprecation_note { - ($replacement:ident) => { - concat!("Use ", stringify!($replacement), - r###" instead. See [issue #1076](https://github.com/dimforge/nalgebra/issues/1076) for more information."###) - } -} +use crate::slice_deprecation_note; /* * @@ -21,343 +14,343 @@ macro_rules! deprecation_note { /// A column-major matrix slice with dimensions known at compile-time. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(SMatrixView)] +#[deprecated = slice_deprecation_note!(SMatrixView)] pub type SMatrixSlice<'a, T, const R: usize, const C: usize> = Matrix, Const, ViewStorage<'a, T, Const, Const, Const<1>, Const>>; /// A column-major matrix slice dynamic numbers of rows and columns. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(DMatrixView)] +#[deprecated = slice_deprecation_note!(DMatrixView)] pub type DMatrixSlice<'a, T, RStride = U1, CStride = Dynamic> = Matrix>; /// A column-major 1x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView1)] +#[deprecated = slice_deprecation_note!(MatrixView1)] pub type MatrixSlice1<'a, T, RStride = U1, CStride = U1> = Matrix>; /// A column-major 2x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView2)] +#[deprecated = slice_deprecation_note!(MatrixView2)] pub type MatrixSlice2<'a, T, RStride = U1, CStride = U2> = Matrix>; /// A column-major 3x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView3)] +#[deprecated = slice_deprecation_note!(MatrixView3)] pub type MatrixSlice3<'a, T, RStride = U1, CStride = U3> = Matrix>; /// A column-major 4x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView4)] +#[deprecated = slice_deprecation_note!(MatrixView4)] pub type MatrixSlice4<'a, T, RStride = U1, CStride = U4> = Matrix>; /// A column-major 5x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView5)] +#[deprecated = slice_deprecation_note!(MatrixView5)] pub type MatrixSlice5<'a, T, RStride = U1, CStride = U5> = Matrix>; /// A column-major 6x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView6)] +#[deprecated = slice_deprecation_note!(MatrixView6)] pub type MatrixSlice6<'a, T, RStride = U1, CStride = U6> = Matrix>; /// A column-major 1x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView1x2)] +#[deprecated = slice_deprecation_note!(MatrixView1x2)] pub type MatrixSlice1x2<'a, T, RStride = U1, CStride = U1> = Matrix>; /// A column-major 1x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView1x3)] +#[deprecated = slice_deprecation_note!(MatrixView1x3)] pub type MatrixSlice1x3<'a, T, RStride = U1, CStride = U1> = Matrix>; /// A column-major 1x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView1x4)] +#[deprecated = slice_deprecation_note!(MatrixView1x4)] pub type MatrixSlice1x4<'a, T, RStride = U1, CStride = U1> = Matrix>; /// A column-major 1x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView1x5)] +#[deprecated = slice_deprecation_note!(MatrixView1x5)] pub type MatrixSlice1x5<'a, T, RStride = U1, CStride = U1> = Matrix>; /// A column-major 1x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView1x6)] +#[deprecated = slice_deprecation_note!(MatrixView1x6)] pub type MatrixSlice1x6<'a, T, RStride = U1, CStride = U1> = Matrix>; /// A column-major 2x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView2x1)] +#[deprecated = slice_deprecation_note!(MatrixView2x1)] pub type MatrixSlice2x1<'a, T, RStride = U1, CStride = U2> = Matrix>; /// A column-major 2x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView2x3)] +#[deprecated = slice_deprecation_note!(MatrixView2x3)] pub type MatrixSlice2x3<'a, T, RStride = U1, CStride = U2> = Matrix>; /// A column-major 2x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView2x4)] +#[deprecated = slice_deprecation_note!(MatrixView2x4)] pub type MatrixSlice2x4<'a, T, RStride = U1, CStride = U2> = Matrix>; /// A column-major 2x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView2x5)] +#[deprecated = slice_deprecation_note!(MatrixView2x5)] pub type MatrixSlice2x5<'a, T, RStride = U1, CStride = U2> = Matrix>; /// A column-major 2x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView2x6)] +#[deprecated = slice_deprecation_note!(MatrixView2x6)] pub type MatrixSlice2x6<'a, T, RStride = U1, CStride = U2> = Matrix>; /// A column-major 3x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView3x1)] +#[deprecated = slice_deprecation_note!(MatrixView3x1)] pub type MatrixSlice3x1<'a, T, RStride = U1, CStride = U3> = Matrix>; /// A column-major 3x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView3x2)] +#[deprecated = slice_deprecation_note!(MatrixView3x2)] pub type MatrixSlice3x2<'a, T, RStride = U1, CStride = U3> = Matrix>; /// A column-major 3x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView3x4)] +#[deprecated = slice_deprecation_note!(MatrixView3x4)] pub type MatrixSlice3x4<'a, T, RStride = U1, CStride = U3> = Matrix>; /// A column-major 3x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView3x5)] +#[deprecated = slice_deprecation_note!(MatrixView3x5)] pub type MatrixSlice3x5<'a, T, RStride = U1, CStride = U3> = Matrix>; /// A column-major 3x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView3x6)] +#[deprecated = slice_deprecation_note!(MatrixView3x6)] pub type MatrixSlice3x6<'a, T, RStride = U1, CStride = U3> = Matrix>; /// A column-major 4x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView4x1)] +#[deprecated = slice_deprecation_note!(MatrixView4x1)] pub type MatrixSlice4x1<'a, T, RStride = U1, CStride = U4> = Matrix>; /// A column-major 4x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView4x2)] +#[deprecated = slice_deprecation_note!(MatrixView4x2)] pub type MatrixSlice4x2<'a, T, RStride = U1, CStride = U4> = Matrix>; /// A column-major 4x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView4x3)] +#[deprecated = slice_deprecation_note!(MatrixView4x3)] pub type MatrixSlice4x3<'a, T, RStride = U1, CStride = U4> = Matrix>; /// A column-major 4x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView4x5)] +#[deprecated = slice_deprecation_note!(MatrixView4x5)] pub type MatrixSlice4x5<'a, T, RStride = U1, CStride = U4> = Matrix>; /// A column-major 4x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView4x6)] +#[deprecated = slice_deprecation_note!(MatrixView4x6)] pub type MatrixSlice4x6<'a, T, RStride = U1, CStride = U4> = Matrix>; /// A column-major 5x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView5x1)] +#[deprecated = slice_deprecation_note!(MatrixView5x1)] pub type MatrixSlice5x1<'a, T, RStride = U1, CStride = U5> = Matrix>; /// A column-major 5x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView5x2)] +#[deprecated = slice_deprecation_note!(MatrixView5x2)] pub type MatrixSlice5x2<'a, T, RStride = U1, CStride = U5> = Matrix>; /// A column-major 5x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView5x3)] +#[deprecated = slice_deprecation_note!(MatrixView5x3)] pub type MatrixSlice5x3<'a, T, RStride = U1, CStride = U5> = Matrix>; /// A column-major 5x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView5x4)] +#[deprecated = slice_deprecation_note!(MatrixView5x4)] pub type MatrixSlice5x4<'a, T, RStride = U1, CStride = U5> = Matrix>; /// A column-major 5x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView5x6)] +#[deprecated = slice_deprecation_note!(MatrixView5x6)] pub type MatrixSlice5x6<'a, T, RStride = U1, CStride = U5> = Matrix>; /// A column-major 6x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView6x1)] +#[deprecated = slice_deprecation_note!(MatrixView6x1)] pub type MatrixSlice6x1<'a, T, RStride = U1, CStride = U6> = Matrix>; /// A column-major 6x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView6x2)] +#[deprecated = slice_deprecation_note!(MatrixView6x2)] pub type MatrixSlice6x2<'a, T, RStride = U1, CStride = U6> = Matrix>; /// A column-major 6x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView6x3)] +#[deprecated = slice_deprecation_note!(MatrixView6x3)] pub type MatrixSlice6x3<'a, T, RStride = U1, CStride = U6> = Matrix>; /// A column-major 6x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView6x4)] +#[deprecated = slice_deprecation_note!(MatrixView6x4)] pub type MatrixSlice6x4<'a, T, RStride = U1, CStride = U6> = Matrix>; /// A column-major 6x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixView6x5)] +#[deprecated = slice_deprecation_note!(MatrixView6x5)] pub type MatrixSlice6x5<'a, T, RStride = U1, CStride = U6> = Matrix>; /// A column-major matrix slice with 1 row and a number of columns chosen at runtime. -#[deprecated = deprecation_note!(MatrixView1xX)] +#[deprecated = slice_deprecation_note!(MatrixView1xX)] pub type MatrixSlice1xX<'a, T, RStride = U1, CStride = U1> = Matrix>; /// A column-major matrix slice with 2 rows and a number of columns chosen at runtime. -#[deprecated = deprecation_note!(MatrixView2xX)] +#[deprecated = slice_deprecation_note!(MatrixView2xX)] pub type MatrixSlice2xX<'a, T, RStride = U1, CStride = U2> = Matrix>; /// A column-major matrix slice with 3 rows and a number of columns chosen at runtime. -#[deprecated = deprecation_note!(MatrixView3xX)] +#[deprecated = slice_deprecation_note!(MatrixView3xX)] pub type MatrixSlice3xX<'a, T, RStride = U1, CStride = U3> = Matrix>; /// A column-major matrix slice with 4 rows and a number of columns chosen at runtime. -#[deprecated = deprecation_note!(MatrixView4xX)] +#[deprecated = slice_deprecation_note!(MatrixView4xX)] pub type MatrixSlice4xX<'a, T, RStride = U1, CStride = U4> = Matrix>; /// A column-major matrix slice with 5 rows and a number of columns chosen at runtime. -#[deprecated = deprecation_note!(MatrixView5xX)] +#[deprecated = slice_deprecation_note!(MatrixView5xX)] pub type MatrixSlice5xX<'a, T, RStride = U1, CStride = U5> = Matrix>; /// A column-major matrix slice with 6 rows and a number of columns chosen at runtime. -#[deprecated = deprecation_note!(MatrixView6xX)] +#[deprecated = slice_deprecation_note!(MatrixView6xX)] pub type MatrixSlice6xX<'a, T, RStride = U1, CStride = U6> = Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 1 column. -#[deprecated = deprecation_note!(MatrixViewXx1)] +#[deprecated = slice_deprecation_note!(MatrixViewXx1)] pub type MatrixSliceXx1<'a, T, RStride = U1, CStride = Dynamic> = Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 2 columns. -#[deprecated = deprecation_note!(MatrixViewXx2)] +#[deprecated = slice_deprecation_note!(MatrixViewXx2)] pub type MatrixSliceXx2<'a, T, RStride = U1, CStride = Dynamic> = Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 3 columns. -#[deprecated = deprecation_note!(MatrixViewXx3)] +#[deprecated = slice_deprecation_note!(MatrixViewXx3)] pub type MatrixSliceXx3<'a, T, RStride = U1, CStride = Dynamic> = Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 4 columns. -#[deprecated = deprecation_note!(MatrixViewXx4)] +#[deprecated = slice_deprecation_note!(MatrixViewXx4)] pub type MatrixSliceXx4<'a, T, RStride = U1, CStride = Dynamic> = Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 5 columns. -#[deprecated = deprecation_note!(MatrixViewXx5)] +#[deprecated = slice_deprecation_note!(MatrixViewXx5)] pub type MatrixSliceXx5<'a, T, RStride = U1, CStride = Dynamic> = Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 6 columns. -#[deprecated = deprecation_note!(MatrixViewXx6)] +#[deprecated = slice_deprecation_note!(MatrixViewXx6)] pub type MatrixSliceXx6<'a, T, RStride = U1, CStride = Dynamic> = Matrix>; /// A column vector slice with dimensions known at compile-time. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(VectorView)] +#[deprecated = slice_deprecation_note!(VectorView)] pub type VectorSlice<'a, T, D, RStride = U1, CStride = D> = Matrix>; /// A column vector slice with dimensions known at compile-time. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(SVectorView)] +#[deprecated = slice_deprecation_note!(SVectorView)] pub type SVectorSlice<'a, T, const D: usize> = Matrix, Const<1>, ViewStorage<'a, T, Const, Const<1>, Const<1>, Const>>; /// A column vector slice dynamic numbers of rows and columns. -#[deprecated = deprecation_note!(DVectorView)] +#[deprecated = slice_deprecation_note!(DVectorView)] pub type DVectorSlice<'a, T, RStride = U1, CStride = Dynamic> = Matrix>; /// A 1D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(VectorView1)] +#[deprecated = slice_deprecation_note!(VectorView1)] pub type VectorSlice1<'a, T, RStride = U1, CStride = U1> = Matrix>; /// A 2D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(VectorView2)] +#[deprecated = slice_deprecation_note!(VectorView2)] pub type VectorSlice2<'a, T, RStride = U1, CStride = U2> = Matrix>; /// A 3D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(VectorView3)] +#[deprecated = slice_deprecation_note!(VectorView3)] pub type VectorSlice3<'a, T, RStride = U1, CStride = U3> = Matrix>; /// A 4D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(VectorView4)] +#[deprecated = slice_deprecation_note!(VectorView4)] pub type VectorSlice4<'a, T, RStride = U1, CStride = U4> = Matrix>; /// A 5D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(VectorView5)] +#[deprecated = slice_deprecation_note!(VectorView5)] pub type VectorSlice5<'a, T, RStride = U1, CStride = U5> = Matrix>; /// A 6D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(VectorView6)] +#[deprecated = slice_deprecation_note!(VectorView6)] pub type VectorSlice6<'a, T, RStride = U1, CStride = U6> = Matrix>; @@ -385,344 +378,344 @@ pub type MatrixSliceMutN<'a, T, D, RStride = U1, CStride = D> = /// A column-major matrix slice with dimensions known at compile-time. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(SMatrixViewMut)] +#[deprecated = slice_deprecation_note!(SMatrixViewMut)] pub type SMatrixSliceMut<'a, T, const R: usize, const C: usize> = Matrix, Const, ViewStorageMut<'a, T, Const, Const, Const<1>, Const>>; /// A column-major matrix slice dynamic numbers of rows and columns. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(DMatrixViewMut)] +#[deprecated = slice_deprecation_note!(DMatrixViewMut)] pub type DMatrixSliceMut<'a, T, RStride = U1, CStride = Dynamic> = Matrix>; /// A column-major 1x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut1)] +#[deprecated = slice_deprecation_note!(MatrixViewMut1)] pub type MatrixSliceMut1<'a, T, RStride = U1, CStride = U1> = Matrix>; /// A column-major 2x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut2)] +#[deprecated = slice_deprecation_note!(MatrixViewMut2)] pub type MatrixSliceMut2<'a, T, RStride = U1, CStride = U2> = Matrix>; /// A column-major 3x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut3)] +#[deprecated = slice_deprecation_note!(MatrixViewMut3)] pub type MatrixSliceMut3<'a, T, RStride = U1, CStride = U3> = Matrix>; /// A column-major 4x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut4)] +#[deprecated = slice_deprecation_note!(MatrixViewMut4)] pub type MatrixSliceMut4<'a, T, RStride = U1, CStride = U4> = Matrix>; /// A column-major 5x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut5)] +#[deprecated = slice_deprecation_note!(MatrixViewMut5)] pub type MatrixSliceMut5<'a, T, RStride = U1, CStride = U5> = Matrix>; /// A column-major 6x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut6)] +#[deprecated = slice_deprecation_note!(MatrixViewMut6)] pub type MatrixSliceMut6<'a, T, RStride = U1, CStride = U6> = Matrix>; /// A column-major 1x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut1x2)] +#[deprecated = slice_deprecation_note!(MatrixViewMut1x2)] pub type MatrixSliceMut1x2<'a, T, RStride = U1, CStride = U1> = Matrix>; /// A column-major 1x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut1x3)] +#[deprecated = slice_deprecation_note!(MatrixViewMut1x3)] pub type MatrixSliceMut1x3<'a, T, RStride = U1, CStride = U1> = Matrix>; /// A column-major 1x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut1x4)] +#[deprecated = slice_deprecation_note!(MatrixViewMut1x4)] pub type MatrixSliceMut1x4<'a, T, RStride = U1, CStride = U1> = Matrix>; /// A column-major 1x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut1x5)] +#[deprecated = slice_deprecation_note!(MatrixViewMut1x5)] pub type MatrixSliceMut1x5<'a, T, RStride = U1, CStride = U1> = Matrix>; /// A column-major 1x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut1x6)] +#[deprecated = slice_deprecation_note!(MatrixViewMut1x6)] pub type MatrixSliceMut1x6<'a, T, RStride = U1, CStride = U1> = Matrix>; /// A column-major 2x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut2x1)] +#[deprecated = slice_deprecation_note!(MatrixViewMut2x1)] pub type MatrixSliceMut2x1<'a, T, RStride = U1, CStride = U2> = Matrix>; /// A column-major 2x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut2x3)] +#[deprecated = slice_deprecation_note!(MatrixViewMut2x3)] pub type MatrixSliceMut2x3<'a, T, RStride = U1, CStride = U2> = Matrix>; /// A column-major 2x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut2x4)] +#[deprecated = slice_deprecation_note!(MatrixViewMut2x4)] pub type MatrixSliceMut2x4<'a, T, RStride = U1, CStride = U2> = Matrix>; /// A column-major 2x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut2x5)] +#[deprecated = slice_deprecation_note!(MatrixViewMut2x5)] pub type MatrixSliceMut2x5<'a, T, RStride = U1, CStride = U2> = Matrix>; /// A column-major 2x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut2x6)] +#[deprecated = slice_deprecation_note!(MatrixViewMut2x6)] pub type MatrixSliceMut2x6<'a, T, RStride = U1, CStride = U2> = Matrix>; /// A column-major 3x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut3x1)] +#[deprecated = slice_deprecation_note!(MatrixViewMut3x1)] pub type MatrixSliceMut3x1<'a, T, RStride = U1, CStride = U3> = Matrix>; /// A column-major 3x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut3x2)] +#[deprecated = slice_deprecation_note!(MatrixViewMut3x2)] pub type MatrixSliceMut3x2<'a, T, RStride = U1, CStride = U3> = Matrix>; /// A column-major 3x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut3x4)] +#[deprecated = slice_deprecation_note!(MatrixViewMut3x4)] pub type MatrixSliceMut3x4<'a, T, RStride = U1, CStride = U3> = Matrix>; /// A column-major 3x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut3x5)] +#[deprecated = slice_deprecation_note!(MatrixViewMut3x5)] pub type MatrixSliceMut3x5<'a, T, RStride = U1, CStride = U3> = Matrix>; /// A column-major 3x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut3x6)] +#[deprecated = slice_deprecation_note!(MatrixViewMut3x6)] pub type MatrixSliceMut3x6<'a, T, RStride = U1, CStride = U3> = Matrix>; /// A column-major 4x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut4x1)] +#[deprecated = slice_deprecation_note!(MatrixViewMut4x1)] pub type MatrixSliceMut4x1<'a, T, RStride = U1, CStride = U4> = Matrix>; /// A column-major 4x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut4x2)] +#[deprecated = slice_deprecation_note!(MatrixViewMut4x2)] pub type MatrixSliceMut4x2<'a, T, RStride = U1, CStride = U4> = Matrix>; /// A column-major 4x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut4x3)] +#[deprecated = slice_deprecation_note!(MatrixViewMut4x3)] pub type MatrixSliceMut4x3<'a, T, RStride = U1, CStride = U4> = Matrix>; /// A column-major 4x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut4x5)] +#[deprecated = slice_deprecation_note!(MatrixViewMut4x5)] pub type MatrixSliceMut4x5<'a, T, RStride = U1, CStride = U4> = Matrix>; /// A column-major 4x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut4x6)] +#[deprecated = slice_deprecation_note!(MatrixViewMut4x6)] pub type MatrixSliceMut4x6<'a, T, RStride = U1, CStride = U4> = Matrix>; /// A column-major 5x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut5x1)] +#[deprecated = slice_deprecation_note!(MatrixViewMut5x1)] pub type MatrixSliceMut5x1<'a, T, RStride = U1, CStride = U5> = Matrix>; /// A column-major 5x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut5x2)] +#[deprecated = slice_deprecation_note!(MatrixViewMut5x2)] pub type MatrixSliceMut5x2<'a, T, RStride = U1, CStride = U5> = Matrix>; /// A column-major 5x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut5x3)] +#[deprecated = slice_deprecation_note!(MatrixViewMut5x3)] pub type MatrixSliceMut5x3<'a, T, RStride = U1, CStride = U5> = Matrix>; /// A column-major 5x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut5x4)] +#[deprecated = slice_deprecation_note!(MatrixViewMut5x4)] pub type MatrixSliceMut5x4<'a, T, RStride = U1, CStride = U5> = Matrix>; /// A column-major 5x6 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut5x6)] +#[deprecated = slice_deprecation_note!(MatrixViewMut5x6)] pub type MatrixSliceMut5x6<'a, T, RStride = U1, CStride = U5> = Matrix>; /// A column-major 6x1 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut6x1)] +#[deprecated = slice_deprecation_note!(MatrixViewMut6x1)] pub type MatrixSliceMut6x1<'a, T, RStride = U1, CStride = U6> = Matrix>; /// A column-major 6x2 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut6x2)] +#[deprecated = slice_deprecation_note!(MatrixViewMut6x2)] pub type MatrixSliceMut6x2<'a, T, RStride = U1, CStride = U6> = Matrix>; /// A column-major 6x3 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut6x3)] +#[deprecated = slice_deprecation_note!(MatrixViewMut6x3)] pub type MatrixSliceMut6x3<'a, T, RStride = U1, CStride = U6> = Matrix>; /// A column-major 6x4 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut6x4)] +#[deprecated = slice_deprecation_note!(MatrixViewMut6x4)] pub type MatrixSliceMut6x4<'a, T, RStride = U1, CStride = U6> = Matrix>; /// A column-major 6x5 matrix slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(MatrixViewMut6x5)] +#[deprecated = slice_deprecation_note!(MatrixViewMut6x5)] pub type MatrixSliceMut6x5<'a, T, RStride = U1, CStride = U6> = Matrix>; /// A column-major matrix slice with 1 row and a number of columns chosen at runtime. -#[deprecated = deprecation_note!(MatrixViewMut1xX)] +#[deprecated = slice_deprecation_note!(MatrixViewMut1xX)] pub type MatrixSliceMut1xX<'a, T, RStride = U1, CStride = U1> = Matrix>; /// A column-major matrix slice with 2 rows and a number of columns chosen at runtime. -#[deprecated = deprecation_note!(MatrixViewMut2xX)] +#[deprecated = slice_deprecation_note!(MatrixViewMut2xX)] pub type MatrixSliceMut2xX<'a, T, RStride = U1, CStride = U2> = Matrix>; /// A column-major matrix slice with 3 rows and a number of columns chosen at runtime. -#[deprecated = deprecation_note!(MatrixViewMut3xX)] +#[deprecated = slice_deprecation_note!(MatrixViewMut3xX)] pub type MatrixSliceMut3xX<'a, T, RStride = U1, CStride = U3> = Matrix>; /// A column-major matrix slice with 4 rows and a number of columns chosen at runtime. -#[deprecated = deprecation_note!(MatrixViewMut4xX)] +#[deprecated = slice_deprecation_note!(MatrixViewMut4xX)] pub type MatrixSliceMut4xX<'a, T, RStride = U1, CStride = U4> = Matrix>; /// A column-major matrix slice with 5 rows and a number of columns chosen at runtime. -#[deprecated = deprecation_note!(MatrixViewMut5xX)] +#[deprecated = slice_deprecation_note!(MatrixViewMut5xX)] pub type MatrixSliceMut5xX<'a, T, RStride = U1, CStride = U5> = Matrix>; /// A column-major matrix slice with 6 rows and a number of columns chosen at runtime. -#[deprecated = deprecation_note!(MatrixViewMut6xX)] +#[deprecated = slice_deprecation_note!(MatrixViewMut6xX)] pub type MatrixSliceMut6xX<'a, T, RStride = U1, CStride = U6> = Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 1 column. -#[deprecated = deprecation_note!(MatrixViewMutXx1)] +#[deprecated = slice_deprecation_note!(MatrixViewMutXx1)] pub type MatrixSliceMutXx1<'a, T, RStride = U1, CStride = Dynamic> = Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 2 columns. -#[deprecated = deprecation_note!(MatrixViewMutXx2)] +#[deprecated = slice_deprecation_note!(MatrixViewMutXx2)] pub type MatrixSliceMutXx2<'a, T, RStride = U1, CStride = Dynamic> = Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 3 columns. -#[deprecated = deprecation_note!(MatrixViewMutXx3)] +#[deprecated = slice_deprecation_note!(MatrixViewMutXx3)] pub type MatrixSliceMutXx3<'a, T, RStride = U1, CStride = Dynamic> = Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 4 columns. -#[deprecated = deprecation_note!(MatrixViewMutXx4)] +#[deprecated = slice_deprecation_note!(MatrixViewMutXx4)] pub type MatrixSliceMutXx4<'a, T, RStride = U1, CStride = Dynamic> = Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 5 columns. -#[deprecated = deprecation_note!(MatrixViewMutXx5)] +#[deprecated = slice_deprecation_note!(MatrixViewMutXx5)] pub type MatrixSliceMutXx5<'a, T, RStride = U1, CStride = Dynamic> = Matrix>; /// A column-major matrix slice with a number of rows chosen at runtime and 6 columns. -#[deprecated = deprecation_note!(MatrixViewMutXx6)] +#[deprecated = slice_deprecation_note!(MatrixViewMutXx6)] pub type MatrixSliceMutXx6<'a, T, RStride = U1, CStride = Dynamic> = Matrix>; /// A column vector slice with dimensions known at compile-time. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(VectorViewMut)] +#[deprecated = slice_deprecation_note!(VectorViewMut)] pub type VectorSliceMut<'a, T, D, RStride = U1, CStride = D> = Matrix>; /// A column vector slice with dimensions known at compile-time. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(SVectorViewMut)] +#[deprecated = slice_deprecation_note!(SVectorViewMut)] pub type SVectorSliceMut<'a, T, const D: usize> = Matrix, Const<1>, ViewStorageMut<'a, T, Const, Const<1>, Const<1>, Const>>; /// A column vector slice dynamic numbers of rows and columns. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(DVectorViewMut)] +#[deprecated = slice_deprecation_note!(DVectorViewMut)] pub type DVectorSliceMut<'a, T, RStride = U1, CStride = Dynamic> = Matrix>; /// A 1D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(VectorViewMut1)] +#[deprecated = slice_deprecation_note!(VectorViewMut1)] pub type VectorSliceMut1<'a, T, RStride = U1, CStride = U1> = Matrix>; /// A 2D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(VectorViewMut2)] +#[deprecated = slice_deprecation_note!(VectorViewMut2)] pub type VectorSliceMut2<'a, T, RStride = U1, CStride = U2> = Matrix>; /// A 3D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(VectorViewMut3)] +#[deprecated = slice_deprecation_note!(VectorViewMut3)] pub type VectorSliceMut3<'a, T, RStride = U1, CStride = U3> = Matrix>; /// A 4D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(VectorViewMut4)] +#[deprecated = slice_deprecation_note!(VectorViewMut4)] pub type VectorSliceMut4<'a, T, RStride = U1, CStride = U4> = Matrix>; /// A 5D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(VectorViewMut5)] +#[deprecated = slice_deprecation_note!(VectorViewMut5)] pub type VectorSliceMut5<'a, T, RStride = U1, CStride = U5> = Matrix>; /// A 6D column vector slice. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** -#[deprecated = deprecation_note!(VectorViewMut6)] +#[deprecated = slice_deprecation_note!(VectorViewMut6)] pub type VectorSliceMut6<'a, T, RStride = U1, CStride = U6> = Matrix>; diff --git a/src/lib.rs b/src/lib.rs index 86a5dc6b..e3e6b66b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -97,6 +97,19 @@ an optimized set of tools for computer graphics and physics. Those features incl )] #![cfg_attr(not(feature = "std"), no_std)] +/// Generates an appropriate deprecation note with a suggestion for replacement. +/// +/// Used for deprecating slice types in various locations throughout the library. +/// See #1076 for more information. +macro_rules! slice_deprecation_note { + ($replacement:ident) => { + concat!("Use ", stringify!($replacement), + r###" instead. See [issue #1076](https://github.com/dimforge/nalgebra/issues/1076) for more information."###) + } +} + +pub(crate) use slice_deprecation_note; + #[cfg(feature = "rand-no-std")] extern crate rand_package as rand;