You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Are raw pointers fully equivalent to the place they are created from? #591
In Tree Borrows, &raw const/mut expressions don't do anything -- the raw pointer created by this expression just has whatever tag the place they point to has. This makes code like the following legal:
letmut a = 0;let ptr = &rawmut a;
a = 1;*ptr = 2;
*ptr and a are allowed to freely alias.
I think this best reflects programmer expectations. In the early days of Stacked Borrows, this came up as a surprise for multiple people, and one c2rust translation tool had to change the code they generate to deal with this. This also simplifies the model since we no longer have to (somewhat awkwardly) identify when a raw pointer is created from a "safe" place (reference/local/Box), and only retag those. This is in contrast to references which we can just always retag no matter where we encounter them.
Activity