|
|
|
|
|
by ajross
455 days ago
|
|
> In Rust, the compiler does that for you. No it doesn't? That comment is expressing a human analysis. The compiler would allow you to stuff any pointer in that you want, even ones that overlap. You're right that some side effects of the runtime can be exploited to do that analysis. But that's true of C too! (Like, "these are two separate heap blocks", or "these are owned by two separate objects", etc...). Still human analysis. Frankly you're overselling hard here. A human author can absolutely mess that analysis up, which is the whole reason Rust calls it "unsafe" to begin with. |
|
I'm saying that even in a codebase with a lot of unsafe, the checks that are still performed have value.