3 ms·
"safe" and "unsafe" in rust are well defined, but in my opinion it's very confusing and I wish they used different terms. In rust, unsafe means accessing memor
by hn92726819 4y ago
"safe" and "unsafe" in rust are well defined, but in my opinion it's very confusing and I wish they used different terms.
In rust, unsafe means accessing memory that's already freed or unallocated or things like that. You can look up the definition for the full definition.
I think the comment you replied to mistakenly used the term "unsafe" (that's part of the reason I dislike the term; it can mean multiple things). In rust context though, it isn't unsafe to index an array that's out of bounds. I.e. if argc=10 and you call argv[99], that will crash your program but isn't considered "unsafe".