Commits


Jorge C. Leitao authored and Neville Dipale committed 4dfbc8bb9f2
ARROW-10448: [Rust] Remove PrimitiveArray::new that can cause UB This PR removes `PrimitiveArray::new`. `PrimitiveArray::new` is `pub`, but it is dangerous because: * when the buffer's content is not aligned with T, many of its methods cause UB * when used with `null_count > 0`, many calls panic as the null bitmap is `None`, but the `null_count != 0` * when used with `null_count > 0`, it creates an array out of spec (as the buffer for the null bitmap is `None` but the null count is not zero) Since: * a change in this method's signature (to either add the bitmap or remove `null_count`) requires a backward incompatible change * it is only used in tests * we have good offers to create primitive arrays: * from an ArrayData, * from a vector or vector of optionals * from an iterator This PR removes it. Closes #8560 from jorgecarleitao/remove_new Authored-by: Jorge C. Leitao <jorgecarleitao@gmail.com> Signed-off-by: Neville Dipale <nevilledips@gmail.com>