> Why should the first priority be memory safety?
Because it's easy for beginners (and even experts) to create a memory safety bug, which is more critical than most bugs.
> If the first priority is always memory safety, then rust should not have `unsafe` keyword.
Err.. I suppose you don't fully understand how memory safety in Rust can be achieved. Every safe abstraction (function, trait, etc.) depends on unsafe code, either directly or transitively.
What's the difference between a safe function and an unsafe one, then? A safe function won't violate memory safety, no matter what combination of arguments passed to it.