Remix.run Logo
▲ rurban an hour ago

Wait, shock! So you say rust is unsafe by default?

▲weinzierl an hour ago | parent [-]

Not really.

The idea is that safe Rust promises that you can't cause UB without unsafe.

Unfortunately there are cases, where the current rust compiler implementation fails to keep that promise. These cases are all tracked as bugs and it's expected they'll be fixed eventually. AFAIK non of the known cases is unfixable, it just takes time and effort, sometime a lot.

Also note that C++ does not make such promises in the first place, so the equivalent code there isn't a bug, it's just UB.