Skip to content

Commit eadfd63

Browse files
committed
Clean up comment
1 parent 1ea4466 commit eadfd63

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustc_mir/interpret/intern.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,12 @@ pub fn intern_const_alloc_recursive<M: CompileTimeMachine<'mir, 'tcx>>(
358358
alloc.mutability = Mutability::Not;
359359
}
360360
// Raw pointers in promoteds may only point to immutable things so we mark
361-
// everything as immutable. Creating a promoted with interior mutability is UB, but
362-
// there's no way we can check whether the user is using raw pointers correctly.
363-
// So all we can do is mark this as immutable here.
361+
// everything as immutable.
364362
// It is UB to mutate through a raw pointer obtained via an immutable reference.
365363
// Since all references and pointers inside a promoted must by their very definition
366364
// be created from an immutable reference, mutating though them would be UB.
365+
// There's no way we can check whether the user is using raw pointers correctly,
366+
// so all we can do is mark this as immutable here.
367367
InternKind::Promoted => {
368368
alloc.mutability = Mutability::Not;
369369
}
@@ -394,7 +394,7 @@ pub fn intern_const_alloc_recursive<M: CompileTimeMachine<'mir, 'tcx>>(
394394
// We have hit an `AllocId` that belongs to an already interned static,
395395
// and are thus not interning any further.
396396

397-
// E.g. this should be unreachable for `InternKind::Promoted` except for allocations
397+
// For `InternKind::Promoted` this is only reachable for allocations
398398
// created for string and byte string literals, since these are interned immediately
399399
// at creation time.
400400

0 commit comments

Comments
 (0)