ndarray icon indicating copy to clipboard operation
ndarray copied to clipboard

Use of `$crate` in macro patterns is questionable

Open CAD97 opened this issue 3 years ago • 0 comments

See https://github.com/rust-lang/rust/pull/99447#issuecomment-1204019943

The fact that $crate in the macro_rules LHS is accepted and glued into kw::DollarCrate is likely an accidental bug. The single use is an internal macro helper arm,

https://github.com/rust-ndarray/ndarray/blob/f8522cfeb60b64067ffb1886b0509092a3bacd1f/src/slice.rs#L845

which looking at the macro, should probably be written to take $in_dim:expr, $out_dim:expr, like the other arms anyway.

CAD97 avatar Aug 13 '22 04:08 CAD97