Skip to content

Commit c7cff96

Browse files
committed
Revert "No need for expr_2021"
This reverts commit 8944edc.
1 parent e441733 commit c7cff96

26 files changed

Lines changed: 115 additions & 125 deletions

benches/bench1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ fn bench_col_iter(bench: &mut test::Bencher)
795795
}
796796

797797
macro_rules! mat_mul {
798-
($modname:ident, $ty:ident, $(($name:ident, $m:expr, $n:expr, $k:expr))+) => {
798+
($modname:ident, $ty:ident, $(($name:ident, $m:expr_2021, $n:expr_2021, $k:expr_2021))+) => {
799799
mod $modname {
800800
use test::{black_box, Bencher};
801801
use ndarray::Array;

src/array_approx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ mod approx_methods
2929
}
3030

3131
macro_rules! impl_approx_traits {
32-
($approx:ident, $doc:expr) => {
32+
($approx:ident, $doc:expr_2021) => {
3333
mod $approx {
3434
use crate::imp_prelude::*;
3535
use crate::Zip;

src/dimension/conversion.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ macro_rules! tuple_type {
106106
}
107107

108108
macro_rules! tuple_expr {
109-
([$self_:expr] $($index:tt)*) => (
109+
([$self_:expr_2021] $($index:tt)*) => (
110110
( $($self_[$index], )* )
111111
);
112112
}
113113

114114
macro_rules! array_expr {
115-
([$self_:expr] $($index:tt)*) => (
115+
([$self_:expr_2021] $($index:tt)*) => (
116116
[$($self_ . $index, )*]
117117
);
118118
}

src/dimension/dim.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,17 @@ macro_rules! impl_scalar_op {
169169
}
170170

171171
macro_rules! add {
172-
($x:expr, $y:expr) => {
172+
($x:expr_2021, $y:expr_2021) => {
173173
$x += $y;
174174
};
175175
}
176176
macro_rules! sub {
177-
($x:expr, $y:expr) => {
177+
($x:expr_2021, $y:expr_2021) => {
178178
$x -= $y;
179179
};
180180
}
181181
macro_rules! mul {
182-
($x:expr, $y:expr) => {
182+
($x:expr_2021, $y:expr_2021) => {
183183
$x *= $y;
184184
};
185185
}

src/dimension/dimension_trait.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ pub trait Dimension:
402402
// Dimension impls
403403

404404
macro_rules! impl_insert_axis_array(
405-
($n:expr) => (
405+
($n:expr_2021) => (
406406
#[inline]
407407
fn insert_axis(&self, axis: Axis) -> Self::Larger {
408408
debug_assert!(axis.index() <= $n);
@@ -878,7 +878,7 @@ impl Dimension for Dim<[Ix; 3]>
878878
let mut stride = *self;
879879
let mut order = Ix3(0, 1, 2);
880880
macro_rules! swap {
881-
($stride:expr, $order:expr, $x:expr, $y:expr) => {
881+
($stride:expr_2021, $order:expr_2021, $x:expr_2021, $y:expr_2021) => {
882882
if ($stride[$x] as isize).abs() > ($stride[$y] as isize).abs() {
883883
$stride.swap($x, $y);
884884
$order.ixm().swap($x, $y);
@@ -904,7 +904,7 @@ impl Dimension for Dim<[Ix; 3]>
904904
}
905905

906906
macro_rules! large_dim {
907-
($n:expr, $name:ident, $pattern:ty, $larger:ty, { $($insert_axis:tt)* }) => (
907+
($n:expr_2021, $name:ident, $pattern:ty, $larger:ty, { $($insert_axis:tt)* }) => (
908908
impl Dimension for Dim<[Ix; $n]> {
909909
const NDIM: Option<usize> = Some($n);
910910
type Pattern = $pattern;

src/dimension/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/// Indexing macro for Dim<[usize; N]> this
22
/// gets the index at `$i` in the underlying array
33
macro_rules! get {
4-
($dim:expr, $i:expr) => {
4+
($dim:expr_2021, $i:expr_2021) => {
55
(*$dim.ix())[$i]
66
};
77
}
88
macro_rules! getm {
9-
($dim:expr, $i:expr) => {
9+
($dim:expr_2021, $i:expr_2021) => {
1010
(*$dim.ixm())[$i]
1111
};
1212
}

src/dimension/ndindex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ unsafe impl NdIndex<IxDyn> for Ix
160160
}
161161

162162
macro_rules! ndindex_with_array {
163-
($([$n:expr, $ix_n:ident $($index:tt)*])+) => {
163+
($([$n:expr_2021, $ix_n:ident $($index:tt)*])+) => {
164164
$(
165165
// implement NdIndex<Ix2> for [Ix; 2] and so on
166166
unsafe impl NdIndex<$ix_n> for [Ix; $n] {

src/dimension/ops.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ pub trait DimAdd<D: Dimension>
88
}
99

1010
macro_rules! impl_dimadd_const_out_const {
11-
($lhs:expr, $rhs:expr) => {
11+
($lhs:expr_2021, $rhs:expr_2021) => {
1212
impl DimAdd<Dim<[usize; $rhs]>> for Dim<[usize; $lhs]> {
1313
type Output = Dim<[usize; $lhs + $rhs]>;
1414
}
1515
};
1616
}
1717

1818
macro_rules! impl_dimadd_const_out_dyn {
19-
($lhs:expr, IxDyn) => {
19+
($lhs:expr_2021, IxDyn) => {
2020
impl DimAdd<IxDyn> for Dim<[usize; $lhs]> {
2121
type Output = IxDyn;
2222
}
2323
};
24-
($lhs:expr, $rhs:expr) => {
24+
($lhs:expr_2021, $rhs:expr_2021) => {
2525
impl DimAdd<Dim<[usize; $rhs]>> for Dim<[usize; $lhs]> {
2626
type Output = IxDyn;
2727
}

src/dimension/remove_axis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl RemoveAxis for Dim<[Ix; 2]>
4343
}
4444

4545
macro_rules! impl_remove_axis_array(
46-
($($n:expr),*) => (
46+
($($n:expr_2021),*) => (
4747
$(
4848
impl RemoveAxis for Dim<[Ix; $n]>
4949
{

src/dimension/reshape.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,13 @@ fn test_reshape()
151151
use crate::Dim;
152152

153153
macro_rules! test_reshape {
154-
(fail $order:ident from $from:expr, $stride:expr, to $to:expr) => {
154+
(fail $order:ident from $from:expr_2021, $stride:expr_2021, to $to:expr_2021) => {
155155
let res = reshape_dim(&Dim($from), &Dim($stride), &Dim($to), Order::$order);
156156
println!("Reshape {:?} {:?} to {:?}, order {:?}\n => {:?}",
157157
$from, $stride, $to, Order::$order, res);
158158
let _res = res.expect_err("Expected failed reshape");
159159
};
160-
(ok $order:ident from $from:expr, $stride:expr, to $to:expr, $to_stride:expr) => {{
160+
(ok $order:ident from $from:expr_2021, $stride:expr_2021, to $to:expr_2021, $to_stride:expr_2021) => {{
161161
let res = reshape_dim(&Dim($from), &Dim($stride), &Dim($to), Order::$order);
162162
println!("Reshape {:?} {:?} to {:?}, order {:?}\n => {:?}",
163163
$from, $stride, $to, Order::$order, res);

0 commit comments

Comments
 (0)