3 ms·
Rust has pointer provenance which implies very similar constraints to the "typed memory" wording of C/C++.
by zozbot234 1y ago
Rust has pointer provenance which implies very similar constraints to the "typed memory" wording of C/C++.
- AlotOfReading 1y agoDoes it? It's very unclear to me whether something like type punning is prohibited by provenance today. The docs don't provide much clarity, and the comments I can find by ralf suggest the details are undecided. I can't imagine it won't be eventually prohibited since we already have hardware designs prohibiting it and it's a terrible code pattern to begin with, but I don't know if the language currently does so.
- steveklabnik 1y agoThis isn’t correct. Just because Rust has aliasing rules doesn’t mean they’re the same sorts of rules. C and C++ are also looking to adopt more formal provenance rules.