Comment by Thaxll
Go is memory safe by modern standard.
If I show you a UB in Rust without the use of unsafe does it means Rust is unsafe?
Go is memory safe by modern standard.
If I show you a UB in Rust without the use of unsafe does it means Rust is unsafe?
That would mean it, yes. And yeah there is a bug in rust's borrow checker which can trigger something like that for some very special, "no human will ever write code like that" case. But this is an implementation detail for a semantically memory safe language, while in go's case having UB is a language primitive here.
I believe UB without unsafe is considered a bug by the Rust language team.
I should’ve said in my original comment, but I don’t mean to dunk on Go. In practice the issues illustrated in the blog post I linked seem unlikely to cause problems in practice, they are interesting nevertheless.