Closed
Description
Creating a new box on the heap with a reference to the global allocator panics with the following error message:
unsafe precondition(s) violated: ptr::read requires that the pointer argument is aligned and non-null
_ = Box::new_in(0, &Global);
Passing the global allocator directly makes the allocation work smoothly:
_ = Box::new_in(0, Global);
The problem may be related to this or this issue. Although, they have seemingly been resolved.
Testing with this heap allocator does not solve the problem.