We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6ac9447 commit 586145aCopy full SHA for 586145a
compiler/rustc_const_eval/src/interpret/validity.rs
@@ -722,6 +722,10 @@ fn mutability<'mir, 'tcx: 'mir>(
722
}
723
_ => mutability,
724
};
725
+ // In case this allocation exists in our alloc_map (which means it is
726
+ // the static we are evaluating), sanity-check the mutability.
727
+ // We can't do this for other statics as their allocations are only
728
+ // available via the query.
729
if let Some((_, alloc)) = ecx.memory.alloc_map.get(alloc_id) {
730
assert_eq!(alloc.mutability, mutability);
731
0 commit comments