Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweak how we create raw views in accumulate_axis_inplace
We had: 1. let ptr1 = self.raw_view(); // Borrow &self 2. let ptr2 = self.raw_view_mut(); // Borrow &mut self 3. Use ptr1 and ptr2 I'm not an expert - we'll need to study and learn more, and the unsafe rust guidelines are not finished. And this is like the first place and far from the last, where we need to revisit unsafe code in ndarray, for updated rules. It seems as though the steps 1, 2, 3 could be wrong as ptr1 is borrowed from the array data, and its scope straddles the mut borrow of the array data in 2. For this reason, I think this would be better: 1. let ptr2 = self.raw_view_mut() // Borrow &mut self 2. let ptr1 = derive from ptr2 3. use ptr1 and ptr2 RawView should hopefully be our ally in making a better ndarray from the foundation.
- Loading branch information