* Marijn Haverbeke:

> Unfortunately, there's this hole I mentioned before. What this
> analysis guarantees is that the location pointed to by an alias will
> always hold a value of type X — if you reassign to it, the alias will
> still be valid. Except when going through a tag type. If you have an
> alias inside a tag (as alt creates them) and you reassign its parent,
> your alias might not point at memory of the right type anymore.

AFAICS, Ada has a somewhat similar issue (the affected types have
"discriminants with defaults").  Over there, the prevalent feeling
seems to be that destructive update of objects of types with
discriminants with defaults is to blame, and not aliasing.
Nevertheless, the language contains fairly complex rules which prevent
obviously dangerous creation of aliases, but already Ada 83 gave up on
dealing with aliased subprogram arguments, shifting responsibility to
the programmer.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to