File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -95,13 +95,12 @@ subject to the normal borrow checker to make sure it can't outlive that local.
95
95
96
96
When allocation fails in Rust, APIs like ` Box::new ` and ` Vec::push ` have no way
97
97
to indicate that failure, so some divergent execution path needs to be taken.
98
- When using the ` std ` crate, the program will print to ` stderr ` and abort. But
99
- with ` #![no_std] ` and the ` alloc ` crate, it was required to provide a
100
- ` #[alloc_error_handler] ` function, similar to ` #[panic_handler] ` , but that
101
- attribute is still unstable .
98
+ When using the ` std ` crate, the program will print to ` stderr ` and abort.
99
+ As of Rust 1.68.0, binaries which include ` std ` will continue to have
100
+ this behavior. Binaries which do not include ` std ` , only including ` alloc ` , will now ` panic! `
101
+ on allocation failure, which may be further adjusted via a ` #[panic_handler] ` if desired .
102
102
103
- Now in Rust 1.68.0, a default handler is provided which turns that ` alloc ` error
104
- into a ` panic! ` , which may be processed in a ` #[panic_handler] ` like any other.
103
+ In the future, it's likely that the behavior for ` std ` will also be changed to match that of ` alloc ` -only binaries.
105
104
106
105
### Stabilized APIs
107
106
You can’t perform that action at this time.
0 commit comments