Skip to content

Commit b5cce74

Browse files
committed
rename get_global_alloc to try_get_global_alloc
1 parent 1c77e2b commit b5cce74

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ fn define_all_allocs(tcx: TyCtxt<'_>, module: &mut dyn Module, cx: &mut Constant
362362
let (data_id, alloc, section_name) = match todo_item {
363363
TodoItem::Alloc(alloc_id) => {
364364
//println!("alloc_id {}", alloc_id);
365-
let alloc = match tcx.get_global_alloc(alloc_id).unwrap() {
365+
let alloc = match tcx.global_alloc(alloc_id) {
366366
GlobalAlloc::Memory(alloc) => alloc,
367367
GlobalAlloc::Function(_) | GlobalAlloc::Static(_) | GlobalAlloc::Vtable(..) => {
368368
unreachable!()

0 commit comments

Comments
 (0)