We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eadfd63 commit b2c43dcCopy full SHA for b2c43dc
src/librustc_mir/interpret/intern.rs
@@ -361,7 +361,8 @@ pub fn intern_const_alloc_recursive<M: CompileTimeMachine<'mir, 'tcx>>(
361
// everything as immutable.
362
// It is UB to mutate through a raw pointer obtained via an immutable reference.
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.
+ // be created from an immutable reference (and promotion also excludes interior
365
+ // mutability), mutating though them would be UB.
366
// There's no way we can check whether the user is using raw pointers correctly,
367
// so all we can do is mark this as immutable here.
368
InternKind::Promoted => {
0 commit comments