Skip to content

aliasing model summary: fix incorrect definition of liveness - #2394

Open
RalfJung wants to merge 1 commit into
rust-lang:masterfrom
RalfJung:ref-cell-live
Open

RalfJung wants to merge 1 commit into
rust-lang:masterfrom
RalfJung:ref-cell-live

Conversation

@RalfJung

Copy link
Copy Markdown
Member

Reported by @JoJoDeveloping on Zulip.

Cc @rust-lang/opsem

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Oct 20, 2026
@JoJoDeveloping

Copy link
Copy Markdown

I am not sure the reference says what is "part of a reference" but anyway now that we're using that term, we might as well say that this means that deallocating such a reference can only happen when the function has ended or if all parts of the reference are in an unsafecell, whatever that means.

r[undefined.alias]
* Breaking the pointer aliasing rules. The exact aliasing rules are not determined yet, but here is an outline of the general principles:

* `&T` must point to memory that is not mutated while they are live (except for data inside an [`UnsafeCell<U>`]).

@RalfJung RalfJung Oct 21, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit further up we're using this formulation "except for data inside an UnsafeCell". I tried to make it similar but maybe it can be made even more similar.

View changes since the review

@RalfJung

Copy link
Copy Markdown
Member Author

This is not just about deallocation though.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: The marked PR is awaiting review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants