And using it taints the produced binaries.
You can configure the compiler, runtimes or web servers to refuse to load tainted unsafe binaries.
> it has an unsafe keyword for using raw pointers
It has, but you don‘t need it to implement data structures. Standard library developers don’t need it either, they all implemented in safe code.
But it is almost never used (recently the unsafe package even got deleted). And Java has basically everything else written in Java, so it is not as often used as Rust’s unsafe.
Java will have a safe foreign memory API soonish.
A garbage collector won't help you avoid a very common memory leak of having an unbounded cache.