Skip to content

update immutable-checking situation #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions const.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ is actually accepted by the compiler because we know that there is no

*Dynamic check.* The Miri engine enforces this dynamically by ensuring that the
new data that is interned for a constant is all marked as immutable.
(Except for
[data inside promoteds](https://github.com/rust-lang/rust/blob/d538b80ad77949e46989cd355cdec193b574f052/src/librustc_mir/interpret/intern.rs#L363-L367)
which cannot easily be checked, and is thus just *marked* as immutable because
it descends from a shared reference subject to the strict syntactic checks of
lifetime extension.)

Note that a constant *referring to* some already existing mutable memory is
fine: inlining that reference everywhere has the same behavior as computing a
Expand Down