This commit is contained in:
Oliver Scherer 2019-12-23 15:22:36 +01:00
parent 89250b97f5
commit 75bdd95d4e
1 changed files with 2 additions and 1 deletions

View File

@ -327,7 +327,8 @@ pub fn intern_const_alloc_recursive<M: CompileTimeMachine<'mir, 'tcx>>(
// We use `delay_span_bug` here, because this can be reached in the presence
// of fancy transmutes.
if alloc.mutability == Mutability::Mut {
// For better errors later, mark the allocation as immutable (on top of the delayed ICE).
// For better errors later, mark the allocation as immutable
// (on top of the delayed ICE).
alloc.mutability = Mutability::Not;
ecx.tcx.sess.delay_span_bug(ecx.tcx.span, "mutable allocation in constant");
}