1
Fork 0

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

@ -362,7 +362,7 @@ fn define_all_allocs(tcx: TyCtxt<'_>, module: &mut dyn Module, cx: &mut Constant
let (data_id, alloc, section_name) = match todo_item {
TodoItem::Alloc(alloc_id) => {
//println!("alloc_id {}", alloc_id);
let alloc = match tcx.get_global_alloc(alloc_id).unwrap() {
let alloc = match tcx.global_alloc(alloc_id) {
GlobalAlloc::Memory(alloc) => alloc,
GlobalAlloc::Function(_) | GlobalAlloc::Static(_) | GlobalAlloc::Vtable(..) => {
unreachable!()