rename get_global_alloc to try_get_global_alloc

This commit is contained in:
Ralf Jung 2022-07-17 11:40:34 -04:00
parent da5e4d73f1
commit a10d8e4581
10 changed files with 32 additions and 22 deletions

View file

@ -138,7 +138,7 @@ pub(crate) fn deref_mir_constant<'tcx>(
let mplace = ecx.deref_operand(&op).unwrap();
if let Some(alloc_id) = mplace.ptr.provenance {
assert_eq!(
tcx.get_global_alloc(alloc_id).unwrap().unwrap_memory().0.0.mutability,
tcx.global_alloc(alloc_id).unwrap_memory().0.0.mutability,
Mutability::Not,
"deref_mir_constant cannot be used with mutable allocations as \
that could allow pattern matching to observe mutable statics",