File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
src/librustc_mir/interpret Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -361,7 +361,8 @@ pub fn intern_const_alloc_recursive<M: CompileTimeMachine<'mir, 'tcx>>(
361
361
// everything as immutable.
362
362
// It is UB to mutate through a raw pointer obtained via an immutable reference.
363
363
// Since all references and pointers inside a promoted must by their very definition
364
- // be created from an immutable reference, mutating though them would be UB.
364
+ // be created from an immutable reference (and promotion also excludes interior
365
+ // mutability), mutating though them would be UB.
365
366
// There's no way we can check whether the user is using raw pointers correctly,
366
367
// so all we can do is mark this as immutable here.
367
368
InternKind :: Promoted => {
You can’t perform that action at this time.
0 commit comments