Hello everyone! Recently, I've learned about the no_global_oom_handling option and tried to test how it works. I'm trying to build a simple program with:
However, I cannot compile even an "empty" program (that only consists of fn main() {}) in such mode, since it reports errors in the "gimli" crate (that I don't explicitly depend on). How can it be fixed?
You do depend on gimli through std (for DWARF, likely used by backtraces/unwinding). The crate probably doesn't support being used without global OOM handling.
You can try building with panic=abort (or even -Z build-std-features=panic_immediate_abort). If that doesn't work, try building entirely #![no_std].
Almost all crates (that allocate) expect a global OOM handler to exist.
P.S. Also, I noticed that using #[no_panic] macro from no_panics create also prevents any use of infallible memory allocation API. It may be used where global OOM handling is undesirable.