about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Scherer <github35764891676564198441@oli-obk.de>2020-01-11 14:45:00 +0100
committerOliver Scherer <github35764891676564198441@oli-obk.de>2020-01-15 10:48:22 +0100
commitb2c43dc1adcf1d264b981a506b1840ba42eeea7f (patch)
tree49ebf0f790f563446e6896df6892b518e51e8e2b
parenteadfd63e3fc136aee68fa32e98ea91213ef2e075 (diff)
downloadrust-b2c43dc1adcf1d264b981a506b1840ba42eeea7f.tar.gz
rust-b2c43dc1adcf1d264b981a506b1840ba42eeea7f.zip
Update src/librustc_mir/interpret/intern.rs
Co-Authored-By: Ralf Jung <post@ralfj.de>
-rw-r--r--src/librustc_mir/interpret/intern.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustc_mir/interpret/intern.rs b/src/librustc_mir/interpret/intern.rs
index 0cafd7cbbc0..6fd15cc79a2 100644
--- a/src/librustc_mir/interpret/intern.rs
+++ b/src/librustc_mir/interpret/intern.rs
@@ -361,7 +361,8 @@ pub fn intern_const_alloc_recursive<M: CompileTimeMachine<'mir, 'tcx>>(
                 // everything as immutable.
                 // It is UB to mutate through a raw pointer obtained via an immutable reference.
                 // Since all references and pointers inside a promoted must by their very definition
-                // be created from an immutable reference, mutating though them would be UB.
+                // be created from an immutable reference (and promotion also excludes interior
+                // mutability), mutating though them would be UB.
                 // There's no way we can check whether the user is using raw pointers correctly,
                 // so all we can do is mark this as immutable here.
                 InternKind::Promoted => {