Conversation

Replying to and
Asking for pure curiosity. In C++ i guess he refers to implicit allocations done by copy operators etc. Which are not random but they could be hard to spot. Rust isn’t that bad in that aspect, with more explicit semantics for what is copied or moved. The only exception is drop
1
Rust's high-level standard library has a choice between APIs using panic (unwinding or abort) or reporting an error. The low-level subset of the standard library doesn't provide dynamic allocation. If you're using that, then you can choose to only provide APIs reporting errors.
1
It is annoying that you lose all the standard dynamically allocated collections, etc. and need to fork the libraries if you don't want method variants panicking on OOM. So, for example, you'd want Vec::push(x) to return Option<T> or Result<T, E> to get back `x` on alloc failure.
1
1
Show replies