Rust uses a static garbage collector. It works on the principle of automatic memory management which means it automatically recycles the memory that will not be used again.