3 ms·
Notice that "unsafe" isn't a magic "off" switch, it's just super powers, things you would otherwise be forbidden from doing are now legal, but things you could
by tialaramex 2y ago
Notice that "unsafe" isn't a magic "off" switch, it's just super powers, things you would otherwise be forbidden from doing are now legal, but things you could have done before have the same behaviour - and if everything in an unsafe block doesn't need super powers you'll get a compiler warning saying the unsafe block you wrote was futile.
So, this only does anything interesting if r1 was a raw pointer so that dereferencing it would be prohibited without the unsafe block. If it's just a reference or some smart pointer type then that's fine anyway.