Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Rust has stricter rules than C++. E.g. global mutable variables are way more dangerous in Rust than in C++ - just creating a reference to it can be immediate undefined behaviour.


In Rust, use UnsafeCell.

In C++, multiple references to the same variable may cause «use after free» bug in it destructor.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: