You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think I should add up some comments since I also have read some issues and have some thoughts.
So as we all know, there was a box keyword help us to directly place things on heap.( Thanks to RFC 809 ) But it has been removed by rust-lang/rust#483333, and it explain why the removed this in https://github.com/rust-lang/rust/pull/48333#issuecomment-376876344.
The explain said one thing important that construction in Rust is totally different with C++. Even the author think you can make placement as what Box::new did, there are still unaddressed considerations.
It's upset because It looks like the best way to do that currently is use MaybeUnInit struct and it will make unsafe. As what I've seen in a group, "Only to wait when some big companies have this issue and they want to solve it over money" we can use placement without unsafe.
You can’t eliminate useless stack allocations in Rust | Mantle’s Potato Bakery
The shiny “language of the year” lacks such an important and widely-used feature.
https://csmantle.top/2025/02/19/you-can-t-eliminate-useless-stack-allocations-in-rust.html
The text was updated successfully, but these errors were encountered: