It would be nice if methods could be added to Vec and other common collections that return an error when they are unable to allocate memory. This would make them usable in kernels and microkernel servers and other programs which cannot panic when out of memory.
Looking at Vec, this would mean duplicating
reserve. I suggest a naming the new methods with a
try_ prefix. To avoid having these new methods cluttering up the API, we could require them to be explicitly imported.