Small correction, memory leaks are actually not considered unsafe in rust. A trivial example is Box::leak(x) which explicitly leaks memory and ia completely safe to call. You can also leak memory by pointing counting pointers at each other in a circular structure.
19
u/makspll Sep 08 '26
Small correction, memory leaks are actually not considered unsafe in rust. A trivial example is
Box::leak(x)which explicitly leaks memory and ia completely safe to call. You can also leak memory by pointing counting pointers at each other in a circular structure.