logoalt Hacker News

tredre3yesterday at 4:33 PM1 replyview on HN

The things that unsafe enables are arbitrary pointers, FFI, and accessing union members in a C struct. It seems highly unlikely to me that unsafe would fix any beginner's problem.

.clone() on the other hand is indeed an easy/quick fix for a lot of issues you'd face when learning rust.


Replies

suddenlybananasyesterday at 4:41 PM

I think beginner programmers are unlikely to use unsafe when learning rust but people coming from c or c++ who are beginners at rust might use unsafe all over the place.

show 1 reply