Feature gate: #![feature(more_fallible_allocation_methods)]
This is a tracking issue for adding more fallible allocation methods, i.e. ones where allocation failure will return Err(_) rather than calling some diverging global handler.
It overlaps a bit with #32838, since the most general methods will be fallible and allocator-agnostic.
Public API
Basically, all the methods in the alloc crate that begin with try_. Perhaps others in std someday.
Steps / History
Unresolved Questions
Feature gate:
#![feature(more_fallible_allocation_methods)]This is a tracking issue for adding more fallible allocation methods, i.e. ones where allocation failure will return
Err(_)rather than calling some diverging global handler.It overlaps a bit with #32838, since the most general methods will be fallible and allocator-agnostic.
Public API
Basically, all the methods in the
alloccrate that begin withtry_. Perhaps others instdsomeday.Steps / History
alloc: add some try_* methods Rust-for-Linux needs #86938vec: add try_* methods and a try_vec! macro to make Vec usable in without infallible allocation methods #95051RawVec's, to avoid combinatorial explosion.Unresolved Questions
Iteration with no_global_oom_handling adding in alloc: Add unstable Cfg feature `no_global_oom_handling #84266, proposed to be turned to a feature in RFC: fallible-allocation rfcs#3140
Put methods on other type / in other location to avoid
try_prefix (which is sort of an ad-hoc namespacing trick).