Re:Linux 6.0 arrives with performance improvements and more ...
by DrMeepster on Wednesday August 17, 2022 @01:31AM
(#32492706)
Box operator isn't actually used in Box::new anymore. It's been replaced with a magic attribute, #[rustc_box]
The box operator allows moving the initialization of a datastructure into the heap entirely (and the compiler also auto-insert the malloc calls).
It is largely a one-trick pony that only exists to help out the standard library, nobody should be using it ever. But it is the one instance where the rust compiler will deploy an allocation on the heap without any obvious way to tell that it did that.