@@ -358,12 +358,12 @@ pub fn intern_const_alloc_recursive<M: CompileTimeMachine<'mir, 'tcx>>(
358
358
alloc. mutability = Mutability :: Not ;
359
359
}
360
360
// 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.
364
362
// It is UB to mutate through a raw pointer obtained via an immutable reference.
365
363
// Since all references and pointers inside a promoted must by their very definition
366
364
// 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.
367
367
InternKind :: Promoted => {
368
368
alloc. mutability = Mutability :: Not ;
369
369
}
@@ -394,7 +394,7 @@ pub fn intern_const_alloc_recursive<M: CompileTimeMachine<'mir, 'tcx>>(
394
394
// We have hit an `AllocId` that belongs to an already interned static,
395
395
// and are thus not interning any further.
396
396
397
- // E.g. this should be unreachable for `InternKind::Promoted` except for allocations
397
+ // For `InternKind::Promoted` this is only reachable for allocations
398
398
// created for string and byte string literals, since these are interned immediately
399
399
// at creation time.
400
400
0 commit comments