jorgecarleitao commented on a change in pull request #9232: URL: https://github.com/apache/arrow/pull/9232#discussion_r590660386
########## File path: rust/arrow/src/buffer/mutable.rs ########## @@ -247,7 +247,7 @@ impl MutableBuffer { /// # Safety /// This function must only be used when this buffer was extended with items of type `T`. /// Failure to do so results in undefined behavior. - pub fn typed_data_mut<T: ArrowNativeType>(&mut self) -> &mut [T] { Review comment: If we do this, we must mark the function as unsafe. The underlying design here is that every type representable in a buffer must be `ArrowNativeType`. This opens up the opportunity to transmute the buffer to any type, which is undefined behavior. Instead, IMO we should write `NativeType` instead. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org