Skip to content

Commit b2c43dc

Browse files
oli-obkRalfJung
andcommitted
Update src/librustc_mir/interpret/intern.rs
Co-Authored-By: Ralf Jung <[email protected]>
1 parent eadfd63 commit b2c43dc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc_mir/interpret/intern.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,8 @@ pub fn intern_const_alloc_recursive<M: CompileTimeMachine<'mir, 'tcx>>(
361361
// everything as immutable.
362362
// It is UB to mutate through a raw pointer obtained via an immutable reference.
363363
// 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.
365366
// There's no way we can check whether the user is using raw pointers correctly,
366367
// so all we can do is mark this as immutable here.
367368
InternKind::Promoted => {

0 commit comments

Comments
 (0)