logoalt Hacker News

sean_pedersentoday at 3:44 AM1 replyview on HN

Would this kind of bug have been catched by the Rust compiler?


Replies

autarchtoday at 3:48 AM

I was wondering about this myself. My guess is no, since AFAIK the only way to do this sort manual memory management is to use unsafe code. But there's also things like the (bumpalo)[https://docs.rs/bumpalo/latest/bumpalo] crate in Rust, so maybe you wouldn't need to do this sort of thing by hand, in which case you're as leak-free as the bumpalo crate.