ndarray icon indicating copy to clipboard operation
ndarray copied to clipboard

Fix unsafe blocks in s![] macro

Open jturner314 opened this issue 3 years ago • 1 comments
trafficstars

Before, the user could silently violate safety requirements of SliceInfo::new_unchecked by directly calling s![@parse inconsistent_values], where inconsistent_values represents inconsistent values for the dimensions, etc. Now, the macro calls SliceInfo::new_unchecked only in the ($($t:tt)*) arm, which always constructs the correct values for the call.

jturner314 avatar Aug 13 '22 15:08 jturner314

CI results:

  • The clippy warning is a bug (bad diagnostic) in clippy on the current Rust beta; it's fixed in the latest nightly.
  • The cross_test error is something wrong with the GitHub action -- it's not an issue with ndarray.

jturner314 avatar Aug 13 '22 16:08 jturner314