Update src/librustc_mir/interpret/intern.rs

Co-Authored-By: Ralf Jung <post@ralfj.de>
This commit is contained in:
Oliver Scherer 2019-12-23 14:50:34 +01:00
parent e56a86162c
commit 89250b97f5

View File

@ -327,7 +327,7 @@ 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
// 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");
}