Closed
Description
I was trying to store a large array on the heap, the code produced a run-time error of stack overflow.
fn main() {
let x = Box::new([0; 10_000_000]);
}
I expected the array to be initialised on the heap.
Instead it seems, the array is being initialised onto the stack, and then placed onto the heap, causing the this error message. thread '<main>' has overflowed its stack
.
Meta
rustc --version --verbose
:
rustc 1.2.0 (082e47636 2015-08-03)
binary: rustc
commit-hash: 082e4763615bdbe7b4dd3dfd6fc2210b7773edf5
commit-date: 2015-08-03
host: x86_64-apple-darwin
release: 1.2.0
Metadata
Metadata
Assignees
Labels
No labels