I don't understand why Box::new doesn't return an Option or Result.
The allocation can fail because memory is not unlimited, or something else could happen; what is the behavior in such cases? I can't find any information about it.
I don't understand why Box::new doesn't return an Option or Result.
The allocation can fail because memory is not unlimited, or something else could happen; what is the behavior in such cases? I can't find any information about it.
For someone coming from 2021, linus has same concerns with you.
I do think that the "run-time failure panic" is a fundamental issue.
Hopefully that will be solved through rust team effects.
https://github.com/rust-lang/rust/pull/84266