about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Scherer <github35764891676564198441@oli-obk.de>2020-01-09 17:14:54 +0100
committerOliver Scherer <github35764891676564198441@oli-obk.de>2020-01-15 10:48:22 +0100
commiteadfd63e3fc136aee68fa32e98ea91213ef2e075 (patch)
treec86a83415d01c8d70994abaf1b5703ce01d9b7eb
parent1ea44663c562ac40fbb81f59698e3861d622695b (diff)
downloadrust-eadfd63e3fc136aee68fa32e98ea91213ef2e075.tar.gz
rust-eadfd63e3fc136aee68fa32e98ea91213ef2e075.zip
Clean up comment
-rw-r--r--src/librustc_mir/interpret/intern.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc_mir/interpret/intern.rs b/src/librustc_mir/interpret/intern.rs
index 6008834a573..0cafd7cbbc0 100644
--- a/src/librustc_mir/interpret/intern.rs
+++ b/src/librustc_mir/interpret/intern.rs
@@ -358,12 +358,12 @@ pub fn intern_const_alloc_recursive<M: CompileTimeMachine<'mir, 'tcx>>(
                     alloc.mutability = Mutability::Not;
                 }
                 // Raw pointers in promoteds may only point to immutable things so we mark
-                // everything as immutable. Creating a promoted with interior mutability is UB, but
-                // 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.
+                // 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.
+                // 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 => {
                     alloc.mutability = Mutability::Not;
                 }
@@ -394,7 +394,7 @@ pub fn intern_const_alloc_recursive<M: CompileTimeMachine<'mir, 'tcx>>(
             // We have hit an `AllocId` that belongs to an already interned static,
             // and are thus not interning any further.
 
-            // E.g. this should be unreachable for `InternKind::Promoted` except for allocations
+            // For `InternKind::Promoted` this is only reachable for allocations
             // created for string and byte string literals, since these are interned immediately
             // at creation time.