Allocating array on heap using Box::new([;]) results in stack overflow

⚓ rust    📅 2025-05-06    👤 surdeus    👁️ 4      

surdeus

Warning

This post was published 56 days ago. The information described in this article may have changed.

A similar question was asked before:

But it doesn't look like anybody is able to justify why this is the case despite rust book specifying that this is a way to allocate on heap:

If this is indeed compiler "magic" as some other forums seem to suggest, can someone please point out in source code where that "magic" is happening?

3 posts - 3 participants

Read full topic

🏷️ rust_feed