You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
While I'm not an expert at the unsafe coding guidelines for Rust, and
there are more places in ndarray to revisit, I think it's best to change
change 1 and 2 - they don't pass my internalized borrow checker.
It seems as though the steps 1, 2, 3 could be against the rules 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.
0 commit comments